Skip to content

Commit 2ef3b7e

Browse files
Fix ERROR - Object of type 'bytes' is not JSON serializable when using store_to_xcom_key parameter (#12172)
1 parent df5d871 commit 2ef3b7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def execute(self, context):
137137
if self.store_to_xcom_key:
138138
file_bytes = hook.download(bucket_name=self.bucket, object_name=self.object)
139139
if sys.getsizeof(file_bytes) < MAX_XCOM_SIZE:
140-
context['ti'].xcom_push(key=self.store_to_xcom_key, value=file_bytes)
140+
context['ti'].xcom_push(key=self.store_to_xcom_key, value=str(file_bytes))
141141
else:
142142
raise AirflowException('The size of the downloaded file is too large to push to XCom!')
143143
else:

0 commit comments

Comments
 (0)