eladkal commented on code in PR #28444:
URL: https://github.com/apache/airflow/pull/28444#discussion_r1051961618


##########
airflow/providers/google/cloud/transfers/gcs_to_bigquery.py:
##########
@@ -320,8 +320,10 @@ def execute(self, context: Context):
                 impersonation_chain=self.impersonation_chain,
             )
             if self.schema_object and self.source_format != "DATASTORE_BACKUP":
-                schema_fields = json.loads(gcs_hook.download(self.bucket, 
self.schema_object).decode("utf-8"))
-                self.log.info("Autodetected fields from schema object: %s", 
schema_fields)
+                self.schema_fields = json.loads(
+                    gcs_hook.download(self.schema_object_bucket, 
self.schema_object).decode("utf-8")
+                )
+                self.log.info("Autodetected fields from schema object: %s", 
self.schema_fields)

Review Comment:
   Correct me if I'm wrong but the entire block lines of 316-326 can be 
replaced with same code as we have in 
   
https://github.com/apache/airflow/blob/199359bb3886699904ca075de7bd5fdfe5105c5f/airflow/providers/google/cloud/operators/bigquery.py#L1603-L1611
   
   which is shorter and with no nesting if



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