Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue reported by the community in slack with lineage in Cosmos 1…
….1 (#526) Fix the following issue, that was reported in [slack](https://apache-airflow.slack.com/archives/C059CC42E9W/p1694212778764869) by a user named Sai: "After upgrading to cosmos 1.1, I see the below error in Airflow logs. I don't have any OpenLineage integrations. Is there a way to stop emitting this error?" ``` [2023-09-08, 22:28:07 UTC] {taskinstance.py:1318} INFO - Marking task as SUCCESS. dag_id=high_freq_core_dbt, task_id=dbt_front.daily_company_user_metrics.daily_company_user_metrics_run, execution_date=20230908T183000, start_date=20230908T222730, end_date=20230908T222807 [2023-09-08, 22:28:07 UTC] {manager.py:61} ERROR - Failed to extract metadata 'TaskInstance' object has no attribute 'openlineage_events_completes' task_type=DbtRunLocalOperator airflow_dag_id=high_freq_core_dbt task_id=dbt_front.daily_company_user_metrics.daily_company_user_metrics_run airflow_run_id=scheduled__2023-09-08T18:30:00+00:00 Traceback (most recent call last): File "/home/airflow/python-venvs/data-pipelines/lib/python3.10/site-packages/openlineage/airflow/extractors/manager.py", line 45, in extract_metadata task_metadata = extractor.extract_on_complete(task_instance) File "/home/airflow/python-venvs/data-pipelines/lib/python3.10/site-packages/openlineage/airflow/extractors/base.py", line 116, in extract_on_complete return self._get_openlineage_facets( File "/home/airflow/python-venvs/data-pipelines/lib/python3.10/site-packages/openlineage/airflow/extractors/base.py", line 124, in _get_openlineage_facets facets: OperatorLineage = get_facets_method(*args) File "/home/airflow/python-venvs/data-pipelines/lib/python3.10/site-packages/cosmos/operators/local.py", line 318, in get_openlineage_facets_on_complete for completed in task_instance.openlineage_events_completes: AttributeError: 'TaskInstance' object has no attribute 'openlineage_events_completes' ``` The issue was reported to happen using: * Airflow version: v2.5.1 * dbt version: 1.5.1 * without any intentional setup of OpenLineage Since the issue was reported, I learned that `get_openlineage_facets_on_complete` is called even if `execute` fails because `get_openlineage_facets_on_failure` is not currently implemented. Closes: #530 (Rust dependency issue reported)
- Loading branch information