xfoursea opened a new issue, #23040:
URL: https://github.com/apache/airflow/issues/23040

   ### Apache Airflow Provider(s)
   
   google
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-google==6.3.0
   
   ### Apache Airflow version
   
   2.1.4
   
   ### Operating System
   
   macOS Big Sur version 11.6.1
   
   ### Deployment
   
   Composer
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   Postgres JSON column output contains extra `\`:
   
   `{"info": "{\"phones\": [{\"type\": \"mobile\", \"phone\": \"001001\"}, 
{\"type\": \"fix\", \"phone\": \"002002\"}]}", "name": null}`
   
   While in the previous version the output looks like
   `{"info": {"phones": [{"phone": "001001", "type": "mobile"}, {"phone": 
"002002", "type": "fix"}]}, "name": null}`
   
   The introduced extra `\` will cause JSON parsing error in following 
`GCSToBigQueryOperator`
   
   ### What you think should happen instead
   
   The output should NOT contain extra `\`:
   `{"info": {"phones": [{"phone": "001001", "type": "mobile"}, {"phone": 
"002002", "type": "fix"}]}, "name": null}`
   
   It is caused by this new code change in 
https://github.com/apache/airflow/blob/main/airflow/providers/google/cloud/transfers/postgres_to_gcs.py
   should comment out this block      
   > if isinstance(value, dict):
   >            return json.dumps(value)
   
   ### How to reproduce
   
   Try to output a Postgres table with JSON column --- you may use the the 
`info` above as example.
   
   ### 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