Skip to content

Commit 8d09506

Browse files
authored
Fix download method in GCSToBigQueryOperator (#12442)
closes: #12439
1 parent bf6da16 commit 8d09506

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

β€Žairflow/providers/google/cloud/transfers/gcs_to_bigquery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,11 @@ def execute(self, context):
264264
delegate_to=self.delegate_to,
265265
impersonation_chain=self.impersonation_chain,
266266
)
267-
schema_fields = json.loads(gcs_hook.download(self.bucket, self.schema_object).decode("utf-8"))
267+
blob = gcs_hook.download(
268+
bucket_name=self.bucket,
269+
object_name=self.schema_object,
270+
)
271+
schema_fields = json.loads(blob.decode("utf-8"))
268272
elif self.schema_object is None and self.autodetect is False:
269273
raise AirflowException(
270274
'At least one of `schema_fields`, `schema_object`, or `autodetect` must be passed.'

0 commit comments

Comments
 (0)