PostgresToGCSOperator does not allow nested JSON #23040
Labels
area:providers
good first issue
kind:bug
This is a clearly a bug
provider:google
Google (including GCP) related issues
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 followingGCSToBigQueryOperator
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
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?
Code of Conduct
The text was updated successfully, but these errors were encountered: