mobuchowski commented on code in PR #40953:
URL: https://github.com/apache/airflow/pull/40953#discussion_r1687976586
##########
airflow/providers/openlineage/utils/utils.py:
##########
@@ -80,28 +81,34 @@ def get_job_name(task: TaskInstance) -> str:
return f"{task.dag_id}.{task.task_id}"
-def get_custom_facets(task_instance: TaskInstance | None = None) -> dict[str,
Any]:
- from airflow.providers.openlineage.extractors.manager import
try_import_from_string
-
- custom_facets = {}
+def get_airflow_mapped_task_facet(task_instance: TaskInstance) -> dict[str,
Any]:
# check for -1 comes from SmartSensor compatibility with dynamic task
mapping
# this comes from Airflow code
if hasattr(task_instance, "map_index") and getattr(task_instance,
"map_index") != -1:
- custom_facets["airflow_mappedTask"] =
AirflowMappedTaskRunFacet.from_task_instance(task_instance)
+ return {"airflow_mappedTask":
AirflowMappedTaskRunFacet.from_task_instance(task_instance)}
+ return {}
+
+
+def get_user_provided_run_facets(ti: TaskInstance, ti_state:
TaskInstanceState) -> dict[str, BaseFacet]:
+ from airflow.providers.openlineage.extractors.manager import
try_import_from_string
Review Comment:
That function is written in the same module, you don't need to import it 🙂
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]