zhongjiajie commented on a change in pull request #7903:
URL: https://github.com/apache/airflow/pull/7903#discussion_r459507907
##########
File path: airflow/providers/snowflake/hooks/snowflake.py
##########
@@ -120,14 +120,15 @@ def _get_aws_credentials(self):
intended to be used by external import and export statements
"""
- if self.snowflake_conn_id: # pylint: disable=no-member
- connection_object = self.get_connection(self.snowflake_conn_id) #
pylint: disable=no-member
- if 'aws_secret_access_key' in connection_object.extra_dejson:
- aws_access_key_id = connection_object.extra_dejson.get(
- 'aws_access_key_id')
- aws_secret_access_key = connection_object.extra_dejson.get(
- 'aws_secret_access_key')
- return aws_access_key_id, aws_secret_access_key
+ connection_object = self.connection
+ if 'aws_secret_access_key' in connection_object.extra_dejson:
+ aws_access_key_id = connection_object.extra_dejson.get(
+ 'aws_access_key_id')
+ aws_secret_access_key = connection_object.extra_dejson.get(
+ 'aws_secret_access_key')
+ return aws_access_key_id, aws_secret_access_key
+ else:
+ return None, None
Review comment:
I have to change it to pass CI, I have no idea why previous code could
pass the CI, mypy will raise error cause `aws_access_key_id,
aws_secret_access_key` maybe not define
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]