You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/05/30 09:23:32 UTC

[GitHub] [airflow] tegardp commented on a change in pull request #16160: Fix: GCS To BigQuery source_object

tegardp commented on a change in pull request #16160:
URL: https://github.com/apache/airflow/pull/16160#discussion_r642047217



##########
File path: airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
##########
@@ -286,7 +286,7 @@ def execute(self, context):
         else:
             schema_fields = self.schema_fields
 
-        source_uris = [f'gs://{self.bucket}/{source_object}' for source_object in self.source_objects]
+        source_uris = [f'gs://{self.bucket}/{source_object}' for source_object in self.source_objects] if type(self.source_objects) is list else [f'gs://{self.bucket}/{self.source_objects}'] 

Review comment:
       But if the input is a list, wouldn't it be converted to a 2-dimensional list?
   ```
   self.source_objects = "file1.csv"
   source_object = [self.source_objects]
   output: ["file1.csv"]
   
   self.source_objects = ["file1.csv", "file2.csv", "file3.csv"]
   source_object = [self.source_objects]
   output: [["file1.csv", "file2.csv", "file3.csv"]]
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org