Skip to content

Conversation

@pankajastro
Copy link
Member

currently, if I'm using AWS async conn without aws_session_token in my extra it fails with below error

    async with hook.async_conn as client:
  File "/opt/***/***/providers/amazon/aws/hooks/base_aws.py", line 659, in async_conn
    return self.get_client_type(region_name=self.region_name, deferrable=True)
  File "/opt/***/***/providers/amazon/aws/hooks/base_aws.py", line 605, in get_client_type
    session = self.get_session(region_name=region_name, deferrable=deferrable)
  File "/opt/***/***/providers/amazon/aws/hooks/base_aws.py", line 578, in get_session
    ).create_session(deferrable=deferrable)
  File "/opt/***/***/providers/amazon/aws/hooks/base_aws.py", line 171, in create_session
    self._apply_session_kwargs(session)
  File "/opt/***/***/providers/amazon/aws/hooks/base_aws.py", line 143, in _apply_session_kwargs
    self.conn.session_kwargs["aws_session_token"],

here, I'm changing to get aws_session_token value using get on dic and not indexing


^ 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.

@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Apr 25, 2023
@pankajastro pankajastro marked this pull request as ready for review April 25, 2023 16:15
@pankajastro pankajastro force-pushed the fix_key_error_in_base_hook branch from 0005ab5 to 4d18efc Compare April 25, 2023 18:21
@o-nikolas
Copy link
Contributor

@syedahsn

Copy link
Contributor

@syedahsn syedahsn left a comment

Choose a reason for hiding this comment

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

Nice work! Looks good to me

@eladkal eladkal merged commit a044a21 into apache:main Apr 26, 2023
@pankajastro pankajastro deleted the fix_key_error_in_base_hook branch June 8, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants