Skip to content

Commit

Permalink
Fix ERROR - Object of type 'bytes' is not JSON serializable when usin…
Browse files Browse the repository at this point in the history
…g store_to_xcom_key parameter (#12172)
  • Loading branch information
davideconsonni committed Nov 8, 2020
1 parent df5d871 commit 2ef3b7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/providers/google/cloud/transfers/gcs_to_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def execute(self, context):
if self.store_to_xcom_key:
file_bytes = hook.download(bucket_name=self.bucket, object_name=self.object)
if sys.getsizeof(file_bytes) < MAX_XCOM_SIZE:
context['ti'].xcom_push(key=self.store_to_xcom_key, value=file_bytes)
context['ti'].xcom_push(key=self.store_to_xcom_key, value=str(file_bytes))
else:
raise AirflowException('The size of the downloaded file is too large to push to XCom!')
else:
Expand Down

0 comments on commit 2ef3b7e

Please sign in to comment.
  翻译: