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

AwsAthenaOperator: do not generate client_request_token if not provided #20854

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

XD-DENG
Copy link
Member

@XD-DENG XD-DENG commented Jan 13, 2022

This PR aims to remove an unnecessary logic in AwsAthenaOperator (and in certain use cases, it may cause confusion)

What this PR does

For AwsAthenaOperator, if client_request_token is not provided, we should do nothing here, rather than generating a UUID explicitly for it.

Why do we need this change

  • According to AWS doc (link provided below), boto3 will autopopulate ClientRequestToken if it's not provided. So it's not necessary to generate it explicitly here
  • The current logic means a UUID will be generated when the DAG is being parsed into a DAG object. When we check this DAG object, we will see a "random" client_request_token. This may not be desired (for example in the product my team is running, this is causing issue).

Reference

Relevant AWS Doc link: https://boto3.amazonaws.com/v1/documentation/api/1.18.0/reference/services/athena.html?highlight=start_query_execution#Athena.Client.start_query_execution

- According to AWS doc (link provided below), boto3 will autopopulated ClientRequestToken is not provided.
  So it's not necessary to generate it explicitly here
- The current logic means a UUID will be generated when the DAG is being parsed into a DAG object.
  When we check this DAG object, we will see a "random" client_request_token
  This may not be desired (for example in the product my team is running, this is causing issue).

AWS Doc link: https://boto3.amazonaws.com/v1/documentation/api/1.18.0/reference/services/athena.html?highlight=start_query_execution#Athena.Client.start_query_execution
@XD-DENG XD-DENG requested review from ashb, potiuk and kaxil January 13, 2022 11:48
@boring-cyborg boring-cyborg bot added area:providers provider:amazon-aws AWS/Amazon - related issues labels Jan 13, 2022
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.

2 participants