-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Update compatibility with google-cloud-redis>=2.0.0 #13117
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
Conversation
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
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.
Does this suggest a breaking change?
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.
Yes. Unfortunately yes. Upgrading the library version introduces minor behavioral differences, so we will have to add an update entry for these libraries in UPDATING.md.
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.
CAan we keep backwards-compatibility? I think we should change our approach and only introduce backwards-incompatible changes in providers if we absolutely must and there is no other way to solve it.
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.
This will be very problematic because this is changed in the third library and we are just passing that object as JSON. These are the consequences of the fact that our operators are only wrappers on the API and the abstraction layer between the third library and the DAG is relatively thin.
In my opinion, we need to introduce a breaking change. Otherwise, we will be forced to use old and outdated libraries that will not allow us to use new API fields/features.
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.
I added docs.
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.
Is the list of those modified fields known and fixed ? I guess it should be as it comes from the old version of library which is not going to be updated. I guess the values in Xcom come from another operator of ours, and they contain the values returned by CloudMemorystoreGetInstanceOperator - result of MessageToDict method call?
I guess in this case we could - potentially - make it backwards-compatible by modifying the dictionary returned and copying the values with legacy field names? How feasible it is ? Maybe in the new library there is already a fixed list of values or even a code that we could use to do it ?
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.
The word list is not provided explicitly, but we may try to guess these names when comparing types with similar names in the new version of the library, but this will require creating a large key mapping from one version of the library to the new library. This key list is also not fixed as new versions of libraries may contain new keys.
This has its limitation. If we only replace dict keys based on a predefined list of keys, we can accidentally modify user values as well, because Google libraries not often, but sometimes also store values from the user as a key.
https://github.com/googleapis/googleapis/blob/eabe7c0fde64b1451df6ea171b2009238b0df07c/google/cloud/datacatalog/v1/tags.proto#L79
https://github.com/googleapis/googleapis/blob/eabe7c0fde64b1451df6ea171b2009238b0df07c/google/cloud/redis/v1/cloud_redis.proto#L276
For this not to happen, we may collect such cases as path, but we will still have to maintain them.
PS. Google uses the snake_case convention in protobuff, so with this change, Google tried to standardize all field names.
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.
There is one more problem. If we try to rename the keys, then it will not be possible to create an object using this dictionary.
instance_dict = t.xcom_pull('get-instance')
instance = Instance(**instance_dict)
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.
In this case, I think we should put that change on hold and release/merge it together with other breaking changes for google provider. I do not think we have an immediate need to migrate to this new '2.0.0' version. And this should happen IMHO at the point we add more breaking changes together.
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.
All right - after the discussion - seems like we have more breaking changes in this "batch" so this will be fine to make it backwards incompatible and set version to 2.0.0
|
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
|
The Workflow run is cancelling this PR. Building images for the PR has failed. Follow the the workflow link to check the reason. |
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.
I think we need to specify version here. And I think this is a very good way to make backwards incompatible changes here- by adding version number here that indicates what kind of changes we are talking about.
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.
Is the list of those modified fields known and fixed ? I guess it should be as it comes from the old version of library which is not going to be updated. I guess the values in Xcom come from another operator of ours, and they contain the values returned by CloudMemorystoreGetInstanceOperator - result of MessageToDict method call?
I guess in this case we could - potentially - make it backwards-compatible by modifying the dictionary returned and copying the values with legacy field names? How feasible it is ? Maybe in the new library there is already a fixed list of values or even a code that we could use to do it ?
|
The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Backport packages$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*. |
potiuk
left a comment
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.
This change introduces a breking change so we should release it together with other, accumulated breaking changes to avoid unnecessary number of breaking release for Google provider.
|
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
40d04f1 to
92fdc7f
Compare
92fdc7f to
c4b5ead
Compare
(cherry picked from commit 0b626c8)
(cherry picked from commit 0b626c8)
(cherry picked from commit 0b626c8)
Part of: #12116
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, 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 UPDATING.md.