-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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 Volume/VolumeMount KPO DeprecationWarning #19726
Merged
jedcunningham
merged 7 commits into
apache:main
from
dimon222:bugfix/resolve_volume_volumemount_warnings
Dec 16, 2021
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift click to select a range
8b1ef59
Fix Volume/VolumeMount DeprecationWarning
dimon222 1c94032
Adjust all calls to be specific
dimon222 d35e763
Clean imports
dimon222 d6024da
Update airflow/providers/cncf/kubernetes/backcompat/backwards_compat_…
dimon222 e09651f
Update airflow/providers/cncf/kubernetes/backcompat/backwards_compat_…
dimon222 bce1a89
Black
dimon222 27619c6
Recommend only new classes
dimon222 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
@jedcunningham, do you think we should add deprecation warning here (i.e. before calling
to_k8s_client_obj
) in addition to here?Users who import the backcompat modules will get warnings when they do so; but maybe we should also signal here that this logic to convert will be removed.
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.
PS: Isn't it implied by definition of "Deprecation"?
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 don't think we need to show 2 deprecation warnings, and I agree with @dimon222 that it's implied the backcompat conversion will eventually be removed.
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.
Removal is implied by the word deprecation, yes. However, KPO is not making any deprecation warning (which is my concern) yet the KPO will eventually remove this logic. I think 2 deprecations warnings is the lesser of 2 evils here (one for "backcompat is gonna be removed" the other for "we aren't gonna convert forever"), but not a hill to die on and i don't stand in the way.
Further, the logic here does not even assume a backcompat class -- it is logic to accept kwargs from a dict. So in that case the user won't have a deprecation warning at all. Again no dying on hills for me here either and i defer to @jedcunningham
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.
@jedcunningham got any better suggestion?
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.
At least in my eyes, "backcompat" and "convert" is the same thing 🤷♂️. I don't think we need to warn about both, but the nuance may be more important for end users.
In cases where there users aren't using the "old" classes directly, like your
resources
example (which willactually get a deprecation warning in #20031), I think we should swallow the deprecation warning and emit a more helpful one for the user.
For example, for users using dict resources, instead of saying:
say (or something like it):
env_vars
also has this issue, not sure if there are others though.Either way, I think the new deprecation warning stuff should be handled in #20031.
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 guess thats a problem of the fact that Resources and Port are combined together under not straightforward named "pod.py", otherwise the filename itself should describe the exact concerning class (ala resources.py and port.py). But you're right, its better be handled separately in #20031. So, should we merge current PR then as is?