-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Deprecate usage of extra[host]
in AWS's connection
#25494
Conversation
My personal thought both of I would rather deprecate
Please also note that connection which read from URI (Environment Variables, SSM backend and might be other sources) would always contain non-None from airflow.models.connection import Connection
conn = Connection(uri="aws://")
assert conn.host is None, f"Expected None but got {conn.host!r}" Also feel free to join discussion in this PR #25416 which basically hide unused connections fields from UI, since it not used in |
Hi @Taragolis. I do agree that |
You've never know end users reaction. Someone frustrate when they see Deprecation and User Warnings and tried to fix asap, some other still use operators/sensors/hooks from |
I think that renaming |
I'm still worry of fact that 'host' has additional logic on URI parse which could add additional complexity - in the fact it only happen if user do not follow documentation and do not URL-encoded their values airflow/airflow/models/connection.py Lines 50 to 60 in 298be50
And a little clarification just for sure that we on the same page. Not just renaming, we deprecate value just for sure that users have a time to change their connections before actually this parameter would be removed. Something like that self.endpoint_url = extra.get("endpoint_url")
if not self.endpoint_url and "host" in extra:
self.endpoint_url = conn.host
warnings.warn(
"some deprecation warning",
DeprecationWarning,
stacklevel=2,
) And also it would be nice to add this in to the documentation |
BTW, I think specify |
f12f477
to
1d3a3a9
Compare
The original goal of this PR was to allow one using |
1d3a3a9
to
3683b13
Compare
AwsBaseHook
not using Connection's hostextra[host]
in AWS's connection
3683b13
to
2e2e86d
Compare
Since #25416 merged would be nice also update placeholder for UI: airflow/airflow/providers/amazon/aws/hooks/base_aws.py Lines 626 to 628 in 6657684
I just thought that we could inform users if they somehow use |
Yeah. Might be a good idea to add warning if host is set |
I want to make provider's release today - woudl be great to get this in. |
@@ -154,6 +154,16 @@ def __post_init__(self, conn: "Connection"): | |||
|
|||
self.endpoint_url = extra.get("host") | |||
|
|||
if self.endpoint_url: | |||
warnings.warn( | |||
"extra['host'] is deprecated and will be removed in a future release." |
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.
@potuik If the Amazon provider is going to be a major version bump this month, is the deprecation message even required? The provider could just stop supporting the host
connection field.
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.
Yeah. That's a bit aggressive, but we could raise plain error here. I do not see this as being a major problem. But removing it altogether is not a good idea because it would likely stop doing that it was doing before without even a warning in some cases.
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.
Understood. So more of a release flow of feature
-> deprecate/message about not using feature
-> remove feature
regardless of major version bump along the way.
2e2e86d
to
4f5b5af
Compare
Just sent a patch addressing both @Taragolis and @potiuk comments |
…nnection. Depreciation is happening in favor of 'endpoint_url' in extra. The Connection.host column is discarded due to lack of semantics as it's easier and more intuitive to pass the whole url than filling its pieces in the UI. Update documentation stating 'host' is deprecated in favor of 'endpoint_url'. Also updated placeholders on the UI. Usage of Connection.host display a deprecation warning.
4f5b5af
to
d9fea88
Compare
The very same check that failed here is failing on |
Yeah I think there was some broken image generation for breeze. Will fix it in a moment. |
Deprecate extra's
host
argument to favor connection's host.closes: #17833
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.