danneaves-ee opened a new issue #20901:
URL: https://github.com/apache/airflow/issues/20901


   ### Apache Airflow Provider(s)
   
   google
   
   ### Versions of Apache Airflow Providers
   
   ```
   $ pip freeze | grep apache-airflow-providers
   apache-airflow-providers-ftp==2.0.1
   apache-airflow-providers-google==6.3.0
   apache-airflow-providers-http==2.0.2
   apache-airflow-providers-imap==2.1.0
   apache-airflow-providers-pagerduty==2.1.0
   apache-airflow-providers-sftp==2.4.0
   apache-airflow-providers-sqlite==2.0.1
   apache-airflow-providers-ssh==2.3.0
   ```
   
   ### Apache Airflow version
   
   2.2.3 (latest released)
   
   ### Operating System
   
   Ubuntu 20.04.3 LTS
   
   ### Deployment
   
   Composer
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   Using 
`airflow.providers.google.cloud.transfers.gcs_to_local.GCSToLocalFilesystemOperator`
 to load the contents of a file into `xcom` unexpectedly casts the file bytes 
to string.
   
   ### What you expected to happen
   
   `GCSToLocalFilesystemOperator` should not cast to string
   
   ### How to reproduce
   
   Store a file on gcs;
   ```
   Hello World!
   ```
   
   Read file to xcom
   ```
   my_task = GCSToLocalFilesystemOperator(
       task_id='my_task',
       bucket=bucket,
       object_name=object_path,
       store_to_xcom_key='my_xcom_key',
   )
   ```
   
   Access via jinja;
   ```
   {{ ti.xcom_pull(task_ids="my_task", key="my_xcom_key") }}
   ```
   
   XCom result is;
   ```
   b'Hello World!'
   ```
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to