Skip to content

Commit

Permalink
Move source_objects datatype check out of GCSToBigQueryOperator.__ini…
Browse files Browse the repository at this point in the history
…t__ (#20347)
  • Loading branch information
josh-fell committed Dec 16, 2021
1 parent 6e51608 commit 17404f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def __init__(
if time_partitioning is None:
time_partitioning = {}
self.bucket = bucket
self.source_objects = source_objects if isinstance(source_objects, list) else [source_objects]
self.source_objects = source_objects
self.schema_object = schema_object

# BQ config
Expand Down Expand Up @@ -279,6 +279,9 @@ def execute(self, context):
else:
schema_fields = self.schema_fields

self.source_objects = (
self.source_objects if isinstance(self.source_objects, list) else [self.source_objects]
)
source_uris = [f'gs://{self.bucket}/{source_object}' for source_object in self.source_objects]
conn = bq_hook.get_conn()
cursor = conn.cursor()
Expand Down

0 comments on commit 17404f1

Please sign in to comment.