JDarDagran commented on code in PR #41034:
URL: https://github.com/apache/airflow/pull/41034#discussion_r1692792098
##########
airflow/lineage/hook.py:
##########
@@ -121,17 +151,32 @@ def add_output_dataset(
scheme=scheme, uri=uri, dataset_kwargs=dataset_kwargs,
dataset_extra=dataset_extra
)
if dataset:
- self.outputs.append((dataset, context))
+ key = self._generate_key(dataset, context)
+ if key not in self._outputs:
+ self._outputs[key] = (dataset, context)
+ self._output_counts[key] = 1
+ else:
+ self._output_counts[key] += 1
+ self._outputs[key] = (dataset, context)
@property
def collected_datasets(self) -> HookLineage:
"""Get the collected hook lineage information."""
- return HookLineage(self.inputs, self.outputs)
+ return HookLineage(
+ [
+ {"dataset": dataset, "count": self._input_counts[key],
"context": context}
Review Comment:
Added `DatasetLineageInfo` class.
--
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]