Fix BigQueryGetDataOperator Response Serialisation #22936
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, if I do not pass the
selected_fields
parameter in BigQueryGetDataOperator which is equivalent toselect * from table
and bigquery table has a column having type Date, Time, Datetime or Decimal then the Python JSON module fails to serialise the response of this operator and the task fails.This happens because when we do not pass the column name in the google client request then it returns a column value in form of an object Python JSON fails to serialise it but if I'm passing the column name then it is returned as a string
There is existing work around it by setting
enable_xcom_pickling
to true in default_airflow.cfg but this is insecureChanges:
After this change below task will succeed and store the response in xcom for any bigquery column type without setting up enable_xcom_pickling to true
@kaxil @phanikumv