From 7a3937f72b7f34baad18a6dcd578dcceff37f83d Mon Sep 17 00:00:00 2001 From: kyungjunleeme Date: Wed, 16 Jul 2025 17:55:57 +0900 Subject: [PATCH 1/3] ADD: get_conn_name and super().__init__ --- providers/http/src/airflow/providers/http/hooks/http.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/providers/http/src/airflow/providers/http/hooks/http.py b/providers/http/src/airflow/providers/http/hooks/http.py index b789688a5d8ea..ee057c536dfc9 100644 --- a/providers/http/src/airflow/providers/http/hooks/http.py +++ b/providers/http/src/airflow/providers/http/hooks/http.py @@ -159,6 +159,9 @@ def auth_type(self): def auth_type(self, v): self._auth_type = v + def get_conn_name(self) -> str: + return getattr(self, self.default_conn_name) + # headers may be passed through directly or in the "extra" field in the connection # definition def get_conn( @@ -172,7 +175,7 @@ def get_conn( :return: A configured requests.Session object. """ session = Session() - connection = self.get_connection(self.http_conn_id) + connection = self.get_connection(self.get_conn_name()) self._set_base_url(connection) session = self._configure_session_from_auth(session, connection) # type: ignore[arg-type] @@ -418,6 +421,7 @@ def __init__( retry_limit: int = 3, retry_delay: float = 1.0, ) -> None: + super().__init__() self.http_conn_id = http_conn_id self.method = method.upper() self.base_url: str = "" From cec4e2c6d7cd40a22f6f1b97409c282b5f759e1e Mon Sep 17 00:00:00 2001 From: kyungjunleeme Date: Thu, 17 Jul 2025 10:11:04 +0900 Subject: [PATCH 2/3] CHG: get_connection in http provider --- providers/http/src/airflow/providers/http/hooks/http.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/providers/http/src/airflow/providers/http/hooks/http.py b/providers/http/src/airflow/providers/http/hooks/http.py index ee057c536dfc9..f785b8cc68a1f 100644 --- a/providers/http/src/airflow/providers/http/hooks/http.py +++ b/providers/http/src/airflow/providers/http/hooks/http.py @@ -159,8 +159,8 @@ def auth_type(self): def auth_type(self, v): self._auth_type = v - def get_conn_name(self) -> str: - return getattr(self, self.default_conn_name) + def get_conn_id(self) -> str: + return getattr(self, self.conn_name_attr) # headers may be passed through directly or in the "extra" field in the connection # definition @@ -175,7 +175,7 @@ def get_conn( :return: A configured requests.Session object. """ session = Session() - connection = self.get_connection(self.get_conn_name()) + connection = self.get_connection(self.get_conn_id()) self._set_base_url(connection) session = self._configure_session_from_auth(session, connection) # type: ignore[arg-type] From 3a4b88ab70d53a07dea9124a1badc18f42d68fa3 Mon Sep 17 00:00:00 2001 From: kyungjunleeme Date: Thu, 17 Jul 2025 11:23:56 +0900 Subject: [PATCH 3/3] CHG: instance_variable --- .../apache/livy/src/airflow/providers/apache/livy/hooks/livy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/apache/livy/src/airflow/providers/apache/livy/hooks/livy.py b/providers/apache/livy/src/airflow/providers/apache/livy/hooks/livy.py index 378d3a0ab7b12..1115c93f05dce 100644 --- a/providers/apache/livy/src/airflow/providers/apache/livy/hooks/livy.py +++ b/providers/apache/livy/src/airflow/providers/apache/livy/hooks/livy.py @@ -92,7 +92,7 @@ def __init__( ) -> None: super().__init__() self.method = "POST" - self.http_conn_id = livy_conn_id + self.livy_conn_id = livy_conn_id self.extra_headers = extra_headers or {} self.extra_options = extra_options or {} self.endpoint_prefix = sanitize_endpoint_prefix(endpoint_prefix)