-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Fix GCSToBigQueryOperator not respecting schema_obj #28444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GCSToBigQueryOperator not respecting schema_obj #28444
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
|
e511757 to
0c65daa
Compare
735546e to
d324b97
Compare
|
Whoops @eladkal - fixed the isort failure |
|
cc @turbaszek, I believe you are codeowner. Can you approve this as well? |
|
Thanks @vchiapaikeo ! |
|
Awesome work, congrats on your first merged pull request! |
|
My pleasure @eladkal! Sure I can try to take a look at it this weekend. |
|
Any idea in which release this one will be shipped ? |
|
Hi, when will this be released? It is not in |
Why do you think so ? |
Hi, that was my fault. I didn't realize our production Airflow was on 2.5.0. I finally put it together and got it sorted and forgot to update here. Sorry, and thanks! |

GCSToBigQueryOperator allows multiple ways to specify schema of the BigQuery table:
This third method seems to be broken in the latest provider version (8.6.0) and will always result in this error:
The reason for this is because this block where
if self.schema_object and self.source_format != "DATASTORE_BACKUP":fails to set self.schema_fields. It only sets the local variable, schema_fields. When self._check_schema_fields is subsequently called here, we enter the first block because autodetect is false and self.schema_fields is not set.This PR sets the instance variable, self.schema_fields when the user passes in a schema_obj. Additionally, it uses self.schema_object_bucket instead of the erroneous self.bucket.
cc: @eladkal
Fixes: #28441