-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DbtTestOperator openlineage-integration-common issue when test does not have test_metadata
#545
Labels
Milestone
Comments
tatiana
added a commit
that referenced
this issue
Sep 27, 2023
Since 1.1.0, the `on_warning_callback` functionality no longer works. It worked on 1.0.5 Closes: #549 Closes: #545 (the fix was necessary to make the `on_warning_callback` test pass) Co-authored-by: Edgaras Navickas <[email protected]> Co-authored-by: Marco Yuen <[email protected]>
tatiana
added a commit
that referenced
this issue
Sep 27, 2023
Since 1.1.0, the `on_warning_callback` functionality no longer works. It worked on 1.0.5 Closes: #549 Closes: #545 (the fix was necessary to make the `on_warning_callback` test pass) Co-authored-by: Edgaras Navickas <[email protected]> Co-authored-by: Marco Yuen <[email protected]>
The fix was released as part of astronomer-cosmos 1.1.2: |
2 tasks
tatiana
added a commit
that referenced
this issue
Sep 28, 2023
Make Cosmos more resilient to Openlineage errors. The Openlineage library raises `KeyError` for some community dbt projects (e.g. https://apache-airflow.slack.com/archives/C059CC42E9W/p1695067128727239): ``` [2023-09-18, 19:54:12 UTC] {taskinstance.py:1935} ERROR - Task failed with exception Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 360, in execute self.build_and_run_cmd(context=context) File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 356, in build_and_run_cmd result = self.run_command(cmd=dbt_cmd, env=env, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 230, in run_command self.calculate_openlineage_events_completes(env, Path(tmp_project_dir)) File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 278, in calculate_openlineage_events_completes events = openlineage_processor.parse() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/openlineage/common/provider/dbt/processor.py", line 211, in parse events += self.parse_test(context, nodes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/openlineage/common/provider/dbt/processor.py", line 308, in parse_test assertions = self.parse_assertions(context, nodes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/openlineage/common/provider/dbt/processor.py", line 367, in parse_assertions assertion=test_node["test_metadata"]["name"], ~~~~~~~~~^^^^^^^^^^^^^^^^^ KeyError: 'test_metadata' ``` Closes: #545 Co-authored-by: Javier Hernández Novoa <[email protected]>
tatiana
added a commit
that referenced
this issue
Sep 28, 2023
Make Cosmos more resilient to Openlineage errors. The Openlineage library raises `KeyError` for some community dbt projects (e.g. https://apache-airflow.slack.com/archives/C059CC42E9W/p1695067128727239): ``` [2023-09-18, 19:54:12 UTC] {taskinstance.py:1935} ERROR - Task failed with exception Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 360, in execute self.build_and_run_cmd(context=context) File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 356, in build_and_run_cmd result = self.run_command(cmd=dbt_cmd, env=env, context=context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 230, in run_command self.calculate_openlineage_events_completes(env, Path(tmp_project_dir)) File "/usr/local/lib/python3.11/site-packages/cosmos/operators/local.py", line 278, in calculate_openlineage_events_completes events = openlineage_processor.parse() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/openlineage/common/provider/dbt/processor.py", line 211, in parse events += self.parse_test(context, nodes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/openlineage/common/provider/dbt/processor.py", line 308, in parse_test assertions = self.parse_assertions(context, nodes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/openlineage/common/provider/dbt/processor.py", line 367, in parse_assertions assertion=test_node["test_metadata"]["name"], ~~~~~~~~~^^^^^^^^^^^^^^^^^ KeyError: 'test_metadata' ``` Closes: #545 Co-authored-by: Javier Hernández Novoa <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue reported in the Slack #airflow-dbt channel by Javier Hernández Novoa, on the
DbtTestOperator
:https://apache-airflow.slack.com/archives/C059CC42E9W/p1695067128727239
This issue is similar to OpenLineage/OpenLineage#2093.
Two actions, that can be split in two tickets as well:
astronomer-cosmos/cosmos/operators/local.py
Line 280 in 27d1945
The text was updated successfully, but these errors were encountered: