mobuchowski commented on code in PR #62171:
URL: https://github.com/apache/airflow/pull/62171#discussion_r2848302511


##########
providers/openlineage/src/airflow/providers/openlineage/extractors/manager.py:
##########
@@ -126,16 +124,15 @@ def extract_metadata(
                     task.task_id,
                     str(task_metadata),
                 )
-                task_metadata = self.validate_task_metadata(task_metadata)
-                if task_metadata:
-                    if (not task_metadata.inputs) and (not 
task_metadata.outputs):
-                        if (hook_lineage := self.get_hook_lineage()) is not 
None:
-                            inputs, outputs = hook_lineage
-                            task_metadata.inputs = inputs
-                            task_metadata.outputs = outputs
-                        else:
-                            self.extract_inlets_and_outlets(task_metadata, 
task)
-                    return task_metadata
+                task_metadata = self.validate_task_metadata(task_metadata) or 
OperatorLineage()
+                # If no inputs and outputs are present - check Hook Lineage
+                if (not task_metadata.inputs) and (not task_metadata.outputs):
+                    hook_lineage = self.get_hook_lineage(task_instance, 
task_instance_state)
+                    if hook_lineage is not None:
+                        task_metadata.merge(hook_lineage)

Review Comment:
   task_metadata = task_metadata.merge(hook_lineage)



-- 
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]

Reply via email to