Skip to content

Commit

Permalink
fix bug construction of Connection object in version 5.0.0rc3 (#25716)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwreeves authored Aug 15, 2022
1 parent 7d0525a commit 762588d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions airflow/providers/amazon/aws/secrets/secrets_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def get_connection(self, conn_id: str) -> Optional[Connection]:
port = int(data['port'])

return Connection(
conn_id=conn_id,
login=data['user'],
password=data['password'],
host=data['host'],
Expand Down
3 changes: 2 additions & 1 deletion tests/providers/amazon/aws/secrets/test_secrets_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def test_get_connection_broken_field_mode_url_encoding(self):
assert conn.login == 'is url encoded'
assert conn.password == 'not url encoded'
assert conn.host == 'not%20idempotent'
assert conn.conn_id == 'test_postgres'

# Remove URL encoding
secrets_manager_backend.are_secret_values_urlencoded = False
Expand All @@ -85,7 +86,7 @@ def test_get_connection_broken_field_mode_url_encoding(self):
assert conn.login == 'is%20url%20encoded'
assert conn.password == 'not url encoded'
assert conn.host == 'not%2520idempotent'

assert conn.conn_id == 'test_postgres'
assert conn.extra_dejson['foo'] == 'bar'

@mock_secretsmanager
Expand Down

0 comments on commit 762588d

Please sign in to comment.