Skip to content

Commit

Permalink
Fix download method in GCSToBigQueryOperator (#12442)
Browse files Browse the repository at this point in the history
closes: #12439
  • Loading branch information
turbaszek authored Nov 18, 2020
1 parent bf6da16 commit 8d09506
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ def execute(self, context):
delegate_to=self.delegate_to,
impersonation_chain=self.impersonation_chain,
)
schema_fields = json.loads(gcs_hook.download(self.bucket, self.schema_object).decode("utf-8"))
blob = gcs_hook.download(
bucket_name=self.bucket,
object_name=self.schema_object,
)
schema_fields = json.loads(blob.decode("utf-8"))
elif self.schema_object is None and self.autodetect is False:
raise AirflowException(
'At least one of `schema_fields`, `schema_object`, or `autodetect` must be passed.'
Expand Down

0 comments on commit 8d09506

Please sign in to comment.