Skip to content

AwsBaseHook isn't using connection.host, using connection.extra.host instead #17833

@alwaysmpe

Description

@alwaysmpe

Apache Airflow version:

Version: v2.1.2
Git Version: .release:2.1.2+d25854dd413aa68ea70fb1ade7fe01425f456192

OS:

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Apache Airflow Provider versions:

Deployment:

Docker compose using reference docker compose from here: https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html

What happened:

Connection specifications have a host field. This is declared as a member variable of the connection class here:

host = Column(String(500))

It's correctly used in the BaseHook class, eg here:
if conn.host:

However in AwsBaseHook, it's expected to be in extra, here:
connection_object = self.get_connection(self.aws_conn_id)
extra_config = connection_object.extra_dejson
endpoint_url = extra_config.get("host")

This should be changed to
endpoint_url = connection_object.host

What you expected to happen:

AwsBaseHook should use the connection.host value, not connection.extra.host

How to reproduce it:

See above code

Anything else we need to know:

Are you willing to submit a PR?

Probably. It'd also be good for someone inexperienced. This would represent a backwards-incompatible change, any problem with that?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions