-
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
Resolve Amazon Hook's region_name
and config
in wrapper
#25336
Resolve Amazon Hook's region_name
and config
in wrapper
#25336
Conversation
118a39c
to
1c2c34d
Compare
errors :) |
A loot of errors. Ah... just forget that AwsHook fallback to default strategy in case if Airflow Connection not exists. @potiuk Interesting why test on pg/Sqlite failed and on MySQL/MSSQL pass |
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
23485ba
to
2d4c9cd
Compare
Add explicit check for |
New possible backward incompatibility: Previously Hook switch to default boto3 strategy if AirflowException raised, after recent changes only if Places where it could happen Assume role by unsupported federation airflow/airflow/providers/amazon/aws/hooks/base_aws.py Lines 276 to 293 in 5d4abbd
Legacy config file parser airflow/airflow/providers/amazon/aws/utils/connection_wrapper.py Lines 248 to 252 in 5d4abbd
|
We do have some intermittent errors more often we would like to have and continuously working on improving - but as in all large and complex systems, this is a constant, almost daily struggle and uphill battle :) - but we have longer and longer periods of mostly-green PRs and I hope it will get only better over time as we add some optimisations and improvements :). |
@vincbeck @Taragolis - I have not look at very detail of that - the code looks good - but the question is is the "backwards-compatibility" problem mentioned above enough to be a "breaking change" or merely an inconvenience? WDYT? That will determine if the next AWS provider release will get a major bump (and if so, we might also want to remove some deprecations). |
I can take care of it if we decide to release major version |
As always it is depends on. Personally for me it might be "bug fixes" and "stop catch to broad exceptions" however someone code might not work anymore. In most cases user should get an error, so it not happen implicit... except changing behaviour with |
Yep. Agree "breaking change" and "bug fix" has a blurry border :) . For me the best criteria I have to decide is will it make our users fix a problem they did not realise they had when the change is implemented. If we fix an actually wrong user behaviour and assumptions that worked "accidentally" before and were not really intentional - then this is not a breaking change. Which I hear from your description is the case right ? |
We just have to make sure that we describe it in the changelog (possibly with some instructions what to do) if we decide to classify it as bug fix - explaining why we think it is a bug-fix, not a breaking change. |
I would suggest might be create create major release. Even if I could prof that it just bug fixes I also have at least 4-5 different changes in session factory creation or aws base hook which could also unlock use connection properties in aws secrets backends (#25326). Many of them introduce "small bug fix" or "small changing behaviour" which can in general classified as 'breaking changes" |
This is fine and if we do so, we will remove most "easy" deprecations (following our more aggressive deprecation removal policy). I think this might also give stronger signal to @ferruzzi @vincbeck @o-nikolas that they might want to (similarly as Google team) want to think about cherry-picking some bugfixes to some past version of the provider following https://github.com/apache/airflow/blob/main/README.md#release-process-for-providers - happy to assist with that. |
I am fine with that |
Sorry, just catching up on this convo. I'm inclined to agree, I think it feels like a bug fix. |
List of bug fixes and improvements which could affect users.
Since 1.0.0 version of amazon-provider use this rules
In additional I personally think that
Fallback to boto3 default Credential strategy only if provided Right now Hook catch too broad
|
I noticed your reply just now. Failed tests showed me that my initial changes was wrong so it wasn't false positive. However tests only failed on this checks:
But not on this checks:
Seems like providers tests only run for PostgreSQL and SQLite backends. In this case, the behavior is expected. |
Correct. If you unfold "Determine how tests are run" entry - it explains it. |
@ferruzzi @vincbeck @o-nikolas WDYT about deprecate switch to default Boto3 Credential Strategy if user specified not existed I thought it would be nice if we warn user that need to specify existed aws_conn_id or explicit set to None. |
I agree, I dont like too having a "hidden"mechanism which takes the default boto3 connection if the connection specified does not exist (or equal |
2d4c9cd
to
6c7a4d3
Compare
6c7a4d3
to
982449f
Compare
Add information about deprecation fallback in case of conn_id not exists |
Follow up #25256
Right now
region_name
andconfig
(botocore.config.Config) could be set in different places with this precedence rules (high to low):With this PR I tried to do in one place (AwsConnectionWrapper) by:
botocore_config
andregion_name
and keep them in wrapperAlso this PR might introduce some breaking changes, previously if
config
specified in Connection than it always overrides config which explicit set in Hook argumentsairflow/airflow/providers/amazon/aws/hooks/base_aws.py
Lines 399 to 402 in 432977b
airflow/airflow/providers/amazon/aws/hooks/base_aws.py
Lines 454 to 460 in 28db8c1
cc: @ferruzzi @o-nikolas @vincbeck