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


##########
providers/google/src/airflow/providers/google/cloud/transfers/bigquery_to_sql.py:
##########
@@ -182,20 +185,30 @@ def get_openlineage_facets_on_complete(self, 
task_instance) -> OperatorLineage |
 
         if self.selected_fields:
             if isinstance(self.selected_fields, str):
-                bigquery_field_names = list(self.selected_fields)
+                transferred_field_names = [
+                    field.strip() for field in self.selected_fields.split(",") 
if field.strip()
+                ]
             else:
-                bigquery_field_names = self.selected_fields
+                transferred_field_names = list(self.selected_fields)
         else:
-            bigquery_field_names = [f.name for f in getattr(table_obj, 
"schema", [])]
+            transferred_field_names = [field.name for field in 
getattr(table_obj, "schema", [])]
 
         input_dataset = Dataset(
             namespace=BIGQUERY_NAMESPACE,
             name=self.source_project_dataset_table,
-            facets=get_facets_from_bq_table_for_given_fields(table_obj, 
bigquery_field_names),
+            facets=get_facets_from_bq_table_for_given_fields(table_obj, 
selected_fields=None),
+        )
+        transferred_input_schema_facet = 
get_facets_from_bq_table_for_given_fields(
+            table_obj, transferred_field_names
+        ).get("schema")

Review Comment:
   We're calling `get_facets_from_bq_table_for_given_fields` twice, can't we 
just read the shchema facet from input dataset here instead of second call?



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