This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 2ef3b7e  Fix ERROR - Object of type 'bytes' is not JSON serializable 
when using store_to_xcom_key parameter (#12172)
2ef3b7e is described below

commit 2ef3b7ef8cafe3bdc8bf8db70fbc519b98576366
Author: Davide Consonni <[email protected]>
AuthorDate: Sun Nov 8 09:17:07 2020 +0100

    Fix ERROR - Object of type 'bytes' is not JSON serializable when using 
store_to_xcom_key parameter (#12172)
---
 airflow/providers/google/cloud/transfers/gcs_to_local.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/providers/google/cloud/transfers/gcs_to_local.py 
b/airflow/providers/google/cloud/transfers/gcs_to_local.py
index 7cc2e23..ac404cc 100644
--- a/airflow/providers/google/cloud/transfers/gcs_to_local.py
+++ b/airflow/providers/google/cloud/transfers/gcs_to_local.py
@@ -137,7 +137,7 @@ class GCSToLocalFilesystemOperator(BaseOperator):
         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:

Reply via email to