Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,15 @@ 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": {},
}

def get_job_details(self, job_id: int) -> Any:
"""
Use Http async call to retrieve metadata for a specific job of an Airbyte Sync.
Expand Down
20 changes: 20 additions & 0 deletions providers/airbyte/tests/unit/airbyte/hooks/test_airbyte.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment on lines +240 to +243
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: How about just assert the whole field_behaviour with dictionary? Maybe it be more straightforward for the test case.


# Check that placeholders is empty
assert field_behaviour["placeholders"] == {}
Loading