-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Enforce deprecation message format with EOL for google provider package #41637
Conversation
5e43f9e
to
bd97094
Compare
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.
NICE! I like it a lot.
bd97094
to
8f471c1
Compare
cc: @dstandish -> You wanted to do something like that - I think the approach proposed by the Google team (for now in google provider is really nice and we could apply it everywhere) |
We should use yyyy-mm-dd (or |
Instead of a pre-commit check and enforcing the style of the message did you consider adding extra (required) args to the deprecated decorator: @deprecated(
reason="Please use `create_build_without_waiting_for_result`",
removed_after="2025-03-01",
category=AirflowProviderDeprecationWarning,
) That way the message can be generated programaticaly and be consistent that way -- no need for a precommit check then? |
Any standarization to deprecations is a good idea 🚀
Something related and still on my todo list (for whenever i have time) is #36952 where i wanted to add a custom decorators (or other construct) for different deprecations (function, arg, arg_value etc.), where we could separate these specific parts (what is deprecated, since when, removal date, what to use instead etc.) into separate arguments so it's easier to generate docs out of it. I think it could work even better now with common.compat provider, maybe we could implement something more global for the airflow codebase 😄 |
Pre-commit check is still needed regardless - because we want to make sure that all deprecations have it. But yes - they could be better structured. one problem with adding new fields - is that since providers and airflow core are separated, anything "common" we come up with will have to go to "common.compat" - especially in the light that providers should be compatible with both Airflow 2 and Airflow 3. So generally - yes better structure at the expense of more cross-provider dependencies. |
It's also explained in this discussion: #37075 (comment), maybe someone will find it useful, so just leaving it here. |
Yep. We've been discussing this :) |
This is the perfect approach, and I'd be happy to apply it, but as it was discussed in #37075 (comment), implementing this new decorator on the Airflow core side would make it very difficult to use in providers as they would have to bump Airflow version in their requirements. The idea of releasing such a decorator in a separated provider package seems like a great solution! Is there any chance to implement it any time soon? I see that this work has already started #36952. @kacpermuda , @potiuk Otherwise, our team would be happy to merge the current PR (with date format fixed) now in order to bring some order to the google provider package now. And once the new provider with the structured deprecation decorator is released, we could adopt the current changes accordingly. |
The
We could also add this decorator to "airflow" utils with the note that it will be usable when min airflow in providers will be |
My main concern, though I’m not sure if it’s entirely valid, is that we previously discussed having a |
It is the same. I imagine (see above) that the decorator WILL become part of "airflow's sdk" eventually (whether it will be named as such or "task.sdk" - generally in Airflow 3 this SDK will become the "util" equivalent - and this The only problem is that we do not YET have the SDK - this is being worked on as part of AIP-72 and will likely come together with restructuring of whole Airlfow repo - including moving providers to separate sub-projects and so on, so it makes very little sense to implement it now in airflow 3, because it will anyhow change. @ashb - do you agree with that assessment ? And note for the future - since you proposed it here - we have to be aware that any kind of the common features that are supposed to be used in providers will have to eventually land in "airflow.sdk" that should be always future-compatible and for now they should land also in "common.compat" if we want to implement it in current providers, since we want the providers to work for both Airlfow 2/3. Does it make sense what I described here? @ashb - is this your understanding as well? |
@kacpermuda , hi, |
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.
Excellent idea!
I'm OK with merging it in its current form after resolving the dates formatting.
If you have time to adjust it to the common.compat
format as suggested - you're welcome to tag me in the new PR and I'll be happy to review it.
@moiseenkov, I’m happy to revisit #36952, but unfortunately, I can’t commit to a specific timeline at the moment. If you have any available resources, feel free to pick it up in the meantime. Regardless, great job with this PR and moving us closer to more standardized deprecations! :) |
I think we can also make it in stages. Stage 1. Implement it in google provider (with google-specific deprecated decorator - with time and pre-commit checks. Google provider is big enough to start "some" standardization efforts - many cases and likely > 50% of all operators and there is a history of things started there and adopted by others and made "common" (system tests for example) I don't think we should aim to have a final solution implemented from day 0 that is applicable to all providers - having google as a good start and "experiment" is IMHO - totally acceptable. WDYT others? |
0794bde
to
fe269c0
Compare
Hi everyone, |
fe269c0
to
c52f944
Compare
c52f944
to
f0418c4
Compare
I am all for it @eladkal @dstandish - I think you had doubts - but I think we can do it as 'google provider specific' for now. I guess small, provider-specific solutions like that are better than inaction and waiting for responses. We can always change it later - no harm done to any other providers. Will merge if I don't hear a complain |
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.
LGTM
f0418c4
to
c941b57
Compare
This PR introduces unification for deprecation messages formatting within Google's provider package by following:
check-code-deprecations
so it enforces a specific message structure containing the end of life date for the deprecated entity. According to the deprecation policy discussed here, this deadline doesn't enforce removal of the deprecated entity from the source code, it only increases transparency and predictability for users, so they knew how much time do they have for the changes on their side.airflow/providers/google
scope.