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

add some important log in aws athena hook #27917

Merged
merged 4 commits into from
Dec 5, 2022
Merged

Conversation

BobDu
Copy link
Contributor

@BobDu BobDu commented Nov 25, 2022

Signed-off-by: BobDu [email protected]

add some important log in aws athena hook

^ Add meaningful description above

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.

@BobDu BobDu requested a review from eladkal as a code owner November 25, 2022 15:52
@boring-cyborg boring-cyborg bot added area:providers provider:amazon-aws AWS/Amazon - related issues labels Nov 25, 2022
Comment on lines 116 to 120
self.log.error(
"Exception while getting query state %s. Query execution id: %s",
ex,
query_execution_id,
)
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to use log.exception instead? (Same for other calls below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if we should use log.exception .
In this PR I just added query execution id in the log message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@uranusjr I modify it to use log.exception

Signed-off-by: BobDu <[email protected]>
@@ -91,8 +94,12 @@ def run_query(
}
if client_request_token:
params["ClientRequestToken"] = client_request_token
if self.log_query:
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason why we want to use a flag (log_query) to configure whether we log or not? In other words, why dont we log regardless ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Oops! I missed that. Thanks for pointing it out. LGTM

@eladkal eladkal self-requested a review December 4, 2022 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:providers provider:amazon-aws AWS/Amazon - related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants