-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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(providers.google): add setter to BigQueryInsertJobOperator sql property #33211
fix(providers.google): add setter to BigQueryInsertJobOperator sql property #33211
Conversation
…operty due to the introduction of this property, users who set the sql attribute to some value will encounter an AttributeError This commit indents to mitigate this issue
@mobuchowski could you take a look? related: #31293 |
…perator sql.setter
Since your PR fixes a bug not detected in the current tests, could you add a new test which reproduces the issue and passes with your change? |
I think the |
Sure. It's late in my time zone now. Will add some tests early tomorrow |
What's the use case here? Migration from
Current solution makes OpenLineage integration not work, reading from user provided data rather than actually executed SQL in |
@Lee-W is the issue appear only in BigQueryExecuteQueryOperator? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Putting a block on merge as this related to vote in progress and for the moment I am not sure if this is the right fix for the problem or maybe the best fix is to get rid of the deprecated class and make major release)
The BigQueryExecuteQueryOperator is deprecated for really long time and this is not the first time it causes pain.
@eladkal it's not changing |
Added alternative PR addressing this: #33214 |
Another interesting possibility would be to turn the property into As discussed in #33084 (comment) - Maybe that is the best fix @Lee-W @mobuchowski ? |
@mobuchowski just in case you were wondering where we use this. Long time back we tried to add an OL extractor for our async operator here: https://github.com/astronomer/astronomer-providers/blob/main/astronomer/providers/google/cloud/extractors/bigquery.py#L131 |
@pankajkoti ooh... this actually makes sense now and does not break OL 😄 BTW, care to migrate those to google provider now that we have OL provider released now? @potiuk yep - this sounds like the best solution for now. According to @pankajkoti's code, this is pretty much irrelevant - the change is for backwards compatibility anyway |
Why? The report claims that |
Added proposed |
@pankajkoti @Lee-W what about adding try/except for that setter on your side, and going with rc2 release? |
@eladkal I will try giving an attempt to elaborate. While exploring openlineage earlier some time back, we wrote a custom OpenLineage extractor for one of our Asynchronous operators at Astronomer https://github.com/astronomer/astronomer-providers/blob/main/astronomer/providers/google/cloud/extractors/bigquery.py In this module, we were trying to set the sql attribute on the BigQueryInsertJobOperator here: https://github.com/astronomer/astronomer-providers/blob/main/astronomer/providers/google/cloud/extractors/bigquery.py Now since that attribute is redefined to be a property now, while we're trying to assign a value there, it gives an error saying we cannot set it. Here is a test that failed for us while we were testing the RC. https://app.circleci.com/pipelines/github/astronomer/astronomer-providers/6315/workflows/3e9c46a3-ee33-4c58-98cb-1994322af0d7/jobs/42343 Like @mobuchowski suggested, we would need to migrate our extractor to accommodate the changes. But meantime it would help us if we have a backward compatible fix and I think #33218 would help us here with the backward compatibility, otherwise users of this OSS async provider who have enabled OpenLineage extractor for this operator would be affected. |
Since we don't have an upper bound for the google provider https://github.com/astronomer/astronomer-providers/blob/main/setup.cfg#L64, our previous releases won't have the try/except block and unfortunately it would break the provider :( |
I'd be for making RC3 with the fix I proposed and @mobuchowski implemented in #33218. While not technically breaking, this is breatking some ways with which Open-Lineage integration works for existing open-lineage integration currently existing in Astronomer. It's a bit funny how Astronomer DOS'ed itself with it a bit - 🤣 - but hey, I think it's important not to break it - especially that this is likely version of the provider that will come with 2.7.0. |
Thanks all for your suggestions and helping out! I think #33218 works better 🎉 Let me close this one. |
due to the introduction of this property, users who set the sql attribute to some value will encounter an AttributeError This commit indents to mitigate this issue
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.