VladaZakharova commented on code in PR #70816:
URL: https://github.com/apache/airflow/pull/70816#discussion_r3704730100


##########
providers/google/src/airflow/providers/google/cloud/transfers/bigquery_to_sql.py:
##########
@@ -228,11 +241,24 @@ def get_openlineage_facets_on_complete(self, 
task_instance) -> OperatorLineage |
                 else:
                     output_name = f"{table_part}"
 
+        transferred_input_dataset = Dataset(
+            namespace=input_dataset.namespace,
+            name=input_dataset.name,
+            facets={"schema": transferred_input_schema_facet} if 
transferred_input_schema_facet else {},
+        )

Review Comment:
   The additional dataset is only used internally for calculating column 
lineage and is not emitted as another input. The identity-lineage helper 
requires the source schema to be a subset of the destination schema, so passing 
the full BigQuery input schema would produce no lineage when only selected 
fields are transferred. I renamed it and added a comment to make that 
distinction clearer.



##########
providers/google/src/airflow/providers/google/cloud/transfers/bigquery_to_sql.py:
##########
@@ -228,11 +241,24 @@ def get_openlineage_facets_on_complete(self, 
task_instance) -> OperatorLineage |
                 else:
                     output_name = f"{table_part}"
 
+        transferred_input_dataset = Dataset(
+            namespace=input_dataset.namespace,
+            name=input_dataset.name,
+            facets={"schema": transferred_input_schema_facet} if 
transferred_input_schema_facet else {},
+        )

Review Comment:
   I still need the temporary dataset for the lineage calculation. For example, 
if BigQuery has id, name, and value, but we only copy id and name, the lineage 
helper returns nothing because value is missing from the output. The temporary 
dataset gives the helper only the fields being copied. It isn’t emitted as 
another OpenLineage input.



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