Skip to content

HttpHook public method url_from_endpoint bug #54112

@fritz-astronomer

Description

@fritz-astronomer

Apache Airflow Provider(s)

http

Versions of Apache Airflow Providers

apache-airflow-providers-http==5.3.3

Apache Airflow version

3.0.4

Operating System

Astro / Debian

Deployment

Astronomer

Deployment details

No response

What happened

No response

What you think should happen instead

No response

How to reproduce

>>> import os
>>> os.environ['AIRFLOW_CONN_FOO'] = '{"conn_type": "http", "host": "foo.bar.com", "schema": "https"}'
>>> from airflow.providers.http.hooks.http import HttpHook
>>> HttpHook(http_conn_id="FOO").url_from_endpoint("baz/bop")
'baz/bop'

Incorrect

>>> import os
>>> os.environ['AIRFLOW_CONN_FOO'] = '{"conn_type": "http", "host": "foo.bar.com", "schema": "https"}'
>>> from airflow.providers.http.hooks.http import HttpHook
>>> h = HttpHook(http_conn_id="FOO")
>>> h.get_conn()  # calls `self._set_base_url(connection)`
>>> h.url_from_endpoint("baz/bop")
'https://foo.bar.com/baz/bop'

✅ correct, called self._set_base_url via get_conn (though was otherwise unnecessary)

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions