Skip to content
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

Refactor and fix AWS secret manager invalid exception #24898

Merged
merged 3 commits into from
Jul 8, 2022
Merged

Refactor and fix AWS secret manager invalid exception #24898

merged 3 commits into from
Jul 8, 2022

Conversation

gitstart-airflow
Copy link
Contributor

closes: #24773
related: #24773


This PR removes the invalid AccessDeniedException in get_secret_value and handle more exceptions.

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 a newsfragement file, named {pr_number}.significant.rst, in newsfragments.

Co-authored-by: gitstart-airflow <[email protected]>
Co-authored-by: gitstart <[email protected]>
Co-authored-by: Vannes Wijaya <[email protected]>
Co-authored-by: Ekene Izukanne <[email protected]>
@potiuk
Copy link
Member

potiuk commented Jul 7, 2022

You will have to rebase (static checks are failing) but also wait until #24901 is merged (it should solve the test failures - my mistake introduced yesterday).

@potiuk
Copy link
Member

potiuk commented Jul 7, 2022

OK. you can rebase now @gitstart-airflow

@potiuk
Copy link
Member

potiuk commented Jul 7, 2022

(and fix the static check along the way. I recommend pre-commit, it will do it for you.

return None
except self.client.exceptions.InvalidRequestException:
self.log.debug(
f"InvalidRequestException: {error_msg}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the the logging statements to use %-formatting instead of f-strings please? This makes sure that the string formatting is deferred until it cannot be avoided. This is a helpful reference which hopefully explains the practice here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josh-fell Finally I got to automate this check. I really do not like wasting mental capacity for things that can be automated during review :) #24910

gitstart and others added 2 commits July 8, 2022 11:19
Co-authored-by: gitstart-airflow <[email protected]>
Co-authored-by: gitstart-bot <[email protected]>
Co-authored-by: Ekene Izukanne <[email protected]>
Co-authored-by: Vannes Wijaya <[email protected]>
@potiuk potiuk merged commit 60c2a3b into apache:main Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWS secret manager: AccessDeniedException is not a valid Exception
4 participants