From d19da64710323334851d32ae8259da5a8804dccf Mon Sep 17 00:00:00 2001 From: Maxime Armstrong Date: Wed, 4 Dec 2024 15:20:24 -0500 Subject: [PATCH] Fix configuration api name --- .../dagster-airbyte/dagster_airbyte/resources.py | 14 +++++++------- .../dagster_airbyte_tests/experimental/conftest.py | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/python_modules/libraries/dagster-airbyte/dagster_airbyte/resources.py b/python_modules/libraries/dagster-airbyte/dagster_airbyte/resources.py index c8b0726367c7b..f679251d04473 100644 --- a/python_modules/libraries/dagster-airbyte/dagster_airbyte/resources.py +++ b/python_modules/libraries/dagster-airbyte/dagster_airbyte/resources.py @@ -32,8 +32,8 @@ AIRBYTE_REST_API_BASE = "https://api.airbyte.com" AIRBYTE_REST_API_VERSION = "v1" -AIRBYTE_SERVER_API_BASE = "https://cloud.airbyte.com/api" -AIRBYTE_SERVER_API_VERSION = "v1" +AIRBYTE_CONFIGURATION_API_BASE = "https://cloud.airbyte.com/api" +AIRBYTE_CONFIGURATION_API_VERSION = "v1" DEFAULT_POLL_INTERVAL_SECONDS = 10 @@ -843,8 +843,8 @@ def rest_api_base_url(self) -> str: return f"{AIRBYTE_REST_API_BASE}/{AIRBYTE_REST_API_VERSION}" @property - def server_api_base_url(self) -> str: - return f"{AIRBYTE_SERVER_API_BASE}/{AIRBYTE_SERVER_API_VERSION}" + def configuration_api_base_url(self) -> str: + return f"{AIRBYTE_CONFIGURATION_API_BASE}/{AIRBYTE_CONFIGURATION_API_VERSION}" @property def all_additional_request_params(self) -> Mapping[str, Any]: @@ -967,13 +967,13 @@ def get_connections(self) -> Mapping[str, Any]: ) def get_connection_details(self, connection_id) -> Mapping[str, Any]: - """Fetches details about a given connection from the Airbyte Server API.""" - # Using the Server API to get the connection details, including streams and their configs. + """Fetches details about a given connection from the Airbyte Configuration API.""" + # Using the Airbyte Configuration API to get the connection details, including streams and their configs. # https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/connections/get return self._make_request( method="POST", endpoint="connections/get", - base_url=self.server_api_base_url, + base_url=self.configuration_api_base_url, data={"connectionId": connection_id}, ) diff --git a/python_modules/libraries/dagster-airbyte/dagster_airbyte_tests/experimental/conftest.py b/python_modules/libraries/dagster-airbyte/dagster_airbyte_tests/experimental/conftest.py index 96ca0882e3e91..aa8a1322e10cf 100644 --- a/python_modules/libraries/dagster-airbyte/dagster_airbyte_tests/experimental/conftest.py +++ b/python_modules/libraries/dagster-airbyte/dagster_airbyte_tests/experimental/conftest.py @@ -3,10 +3,10 @@ import pytest import responses from dagster_airbyte.resources import ( + AIRBYTE_CONFIGURATION_API_BASE, + AIRBYTE_CONFIGURATION_API_VERSION, AIRBYTE_REST_API_BASE, AIRBYTE_REST_API_VERSION, - AIRBYTE_SERVER_API_BASE, - AIRBYTE_SERVER_API_VERSION, ) TEST_WORKSPACE_ID = "some_workspace_id" @@ -45,7 +45,7 @@ } -# Taken from Airbyte Server API documentation +# Taken from Airbyte Configuration API documentation # https://airbyte-public-api-docs.s3.us-east-2.amazonaws.com/rapidoc-api-docs.html#post-/v1/connections/get SAMPLE_CONNECTION_DETAILS = { "connectionId": TEST_CONNECTION_ID, @@ -165,7 +165,7 @@ def fetch_workspace_data_api_mocks_fixture( ) base_api_mocks.add( method=responses.POST, - url=f"{AIRBYTE_SERVER_API_BASE}/{AIRBYTE_SERVER_API_VERSION}/connections/get", + url=f"{AIRBYTE_CONFIGURATION_API_BASE}/{AIRBYTE_CONFIGURATION_API_VERSION}/connections/get", json=SAMPLE_CONNECTION_DETAILS, status=200, )