Skip to content

Commit

Permalink
openlineage: fix failing OL test on main that normalizes sql (#40821)
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
  • Loading branch information
mobuchowski authored Jul 16, 2024
1 parent a10b98e commit 9cdd7c0
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions tests/providers/openlineage/test_sqlparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,9 @@ def test_generate_openlineage_metadata_from_sql(self, mock_parse, parser_returns
]

sql = """INSERT INTO popular_orders_day_of_week (order_day_of_week)
SELECT EXTRACT(ISODOW FROM order_placed_on) AS order_day_of_week
FROM top_delivery_times
--irrelevant comment
)
;
"""
SELECT EXTRACT(ISODOW FROM order_placed_on) AS order_day_of_week
FROM top_delivery_times --irrelevant comment
);"""

hook.get_conn.return_value.cursor.return_value.fetchall.side_effect = returned_rows

Expand All @@ -314,10 +311,9 @@ def test_generate_openlineage_metadata_from_sql(self, mock_parse, parser_returns
mock_parse.return_value = mock_sql_meta

formatted_sql = """INSERT INTO popular_orders_day_of_week (order_day_of_week)
SELECT EXTRACT(ISODOW FROM order_placed_on) AS order_day_of_week
FROM top_delivery_times
)"""
SELECT EXTRACT(ISODOW FROM order_placed_on) AS order_day_of_week
FROM top_delivery_times
)"""
expected_schema = "PUBLIC" if parser_returns_schema else "ANOTHER_SCHEMA"
expected = OperatorLineage(
inputs=[
Expand Down

0 comments on commit 9cdd7c0

Please sign in to comment.