From a0e4dea7e5dcb65514e9edd59875e2de75c308d2 Mon Sep 17 00:00:00 2001 From: Zeglow Date: Thu, 18 Sep 2025 18:22:04 -0700 Subject: [PATCH 1/3] Fix: Make Airbyte connection fields properly labeled in Airflow 3 - Add proper relabeling for Airbyte-specific field meanings - Ensure 'login' displays as 'Client ID' and 'password' as 'Client Secret' - Similar pattern to other provider fixes Closes #55841 --- .../airbyte/src/airflow/providers/airbyte/hooks/airbyte.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py b/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py index 7708a43f98bb5..41cc840d66c43 100644 --- a/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py +++ b/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py @@ -103,7 +103,12 @@ def get_ui_field_behaviour(cls) -> dict[str, Any]: "extra", "port", ], - "relabeling": {"login": "Client ID", "password": "Client Secret", "schema": "Token URL"}, + "relabeling": { + "host": "Server URL", + "login": "Client ID", + "password": "Client Secret", + "schema": "Token URL" + }, "placeholders": {}, } From 496b4c5b307b95177a3577ee9d9171d26bc0b1c6 Mon Sep 17 00:00:00 2001 From: Zeglow Date: Thu, 18 Sep 2025 20:13:29 -0700 Subject: [PATCH 2/3] Add test for get_ui_field_behaviour method - Test that correct fields are hidden (extra, port) - Test that proper relabeling is applied: - host -> Server URL - login -> Client ID - password -> Client Secret - schema -> Token URL - Test that placeholders is empty - Ensures the UI field behavior works correctly for Airbyte connections --- .../tests/unit/airbyte/hooks/test_airbyte.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py b/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py index 9dd563da9aaa9..b1da681c58bc6 100644 --- a/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py +++ b/providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py @@ -224,3 +224,23 @@ def test_create_api_session_with_proxy(self): # Check if the session is created correctly assert hook.airbyte_api is not None assert hook.airbyte_api.sdk_configuration.client.proxies == self._mock_proxy["proxies"] + + def test_get_ui_field_behaviour(self): + """ + Test the UI field behavior configuration for Airbyte connections. + """ + field_behaviour = AirbyteHook.get_ui_field_behaviour() + + # Check that the correct fields are hidden + assert "extra" in field_behaviour["hidden_fields"] + assert "port" in field_behaviour["hidden_fields"] + + # Check that the correct relabeling is applied + relabeling = field_behaviour["relabeling"] + assert relabeling["host"] == "Server URL" + assert relabeling["login"] == "Client ID" + assert relabeling["password"] == "Client Secret" + assert relabeling["schema"] == "Token URL" + + # Check that placeholders is empty + assert field_behaviour["placeholders"] == {} From b3beb3ada346a2f29ae09f274d11d7eec7724bfb Mon Sep 17 00:00:00 2001 From: Zeglow Date: Sat, 27 Sep 2025 19:01:13 -0700 Subject: [PATCH 3/3] fix: Correct formatting in get_ui_field_behaviour method --- .../src/airflow/providers/airbyte/hooks/airbyte.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py b/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py index 41cc840d66c43..2ee24bcf93218 100644 --- a/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py +++ b/providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py @@ -103,15 +103,15 @@ def get_ui_field_behaviour(cls) -> dict[str, Any]: "extra", "port", ], - "relabeling": { - "host": "Server URL", - "login": "Client ID", - "password": "Client Secret", - "schema": "Token URL" - }, + "relabeling": { + "host": "Server URL", + "login": "Client ID", + "password": "Client Secret", + "schema": "Token URL", + }, "placeholders": {}, } - + def get_job_details(self, job_id: int) -> Any: """ Use Http async call to retrieve metadata for a specific job of an Airbyte Sync.