From c6cecbaa0e9abeb033ac3a906b59e6984893183e Mon Sep 17 00:00:00 2001 From: donny Date: Thu, 4 Dec 2025 16:37:48 +0100 Subject: [PATCH 1/4] WIP: Set a more detailed custom_user_agent for the motherduck destination: turning "airbyte" into "airbyte-CLOUD/2.0" or "airbyte-OSS" (depending on the actual values of the environment variables) --- .../destination_motherduck/destination.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py b/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py index d67d8dbe18a8..61e72eb88a83 100644 --- a/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py +++ b/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py @@ -156,7 +156,14 @@ def _get_sql_processor( Get sql processor for processing queries """ catalog_provider = CatalogProvider(configured_catalog) + if self._is_motherduck(db_path): + deployment_mode = os.getenv("DEPLOYMENT_MODE") + custom_user_agent = f"airbyte-{deployment_mode}" if deployment_mode else "airbyte" + + airbyte_version = os.getenv("AIRBYTE_VERSION") + custom_user_agent = f"{custom_user_agent}/{airbyte_version}" if airbyte_version else custom_user_agent + return MotherDuckSqlProcessor( sql_config=MotherDuckConfig( schema_name=schema_name, @@ -164,6 +171,7 @@ def _get_sql_processor( db_path=db_path, database=urlparse(db_path).path, api_key=SecretString(motherduck_token), + custom_user_agent=custom_user_agent, ), catalog_provider=catalog_provider, ) From bacc2427191a10f9b92f18771c00fb90fae3e460 Mon Sep 17 00:00:00 2001 From: donny Date: Mon, 8 Dec 2025 14:01:16 +0100 Subject: [PATCH 2/4] Tweak user agent logic - use the AIRBYTE_EDITION environment variable to distinguish community and cloud deployment, and use the user-agent format specified by MotherDuck. --- .../destination_motherduck/destination.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py b/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py index 61e72eb88a83..18c47fee3c5b 100644 --- a/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py +++ b/airbyte-integrations/connectors/destination-motherduck/destination_motherduck/destination.py @@ -158,11 +158,11 @@ def _get_sql_processor( catalog_provider = CatalogProvider(configured_catalog) if self._is_motherduck(db_path): - deployment_mode = os.getenv("DEPLOYMENT_MODE") - custom_user_agent = f"airbyte-{deployment_mode}" if deployment_mode else "airbyte" - airbyte_version = os.getenv("AIRBYTE_VERSION") - custom_user_agent = f"{custom_user_agent}/{airbyte_version}" if airbyte_version else custom_user_agent + custom_user_agent = f"airbyte/{airbyte_version}" if airbyte_version else "airbyte" + + edition = os.getenv("AIRBYTE_EDITION") + custom_user_agent = f"{custom_user_agent}({edition})" if edition else custom_user_agent return MotherDuckSqlProcessor( sql_config=MotherDuckConfig( From 473bfca04fde26bbffb2a7dd310fcb82c10ed161 Mon Sep 17 00:00:00 2001 From: donny Date: Mon, 8 Dec 2025 14:09:36 +0100 Subject: [PATCH 3/4] Increment image tag assuming #70438 will get merged first. --- .../connectors/destination-motherduck/metadata.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/destination-motherduck/metadata.yaml b/airbyte-integrations/connectors/destination-motherduck/metadata.yaml index 3328aef1623c..03657d67e759 100644 --- a/airbyte-integrations/connectors/destination-motherduck/metadata.yaml +++ b/airbyte-integrations/connectors/destination-motherduck/metadata.yaml @@ -4,7 +4,7 @@ data: connectorSubtype: database connectorType: destination definitionId: 042ee9b5-eb98-4e99-a4e5-3f0d573bee66 - dockerImageTag: 0.1.26 + dockerImageTag: 0.1.28 dockerRepository: airbyte/destination-motherduck githubIssueLabel: destination-motherduck icon: duckdb.svg From 908849f8c49608813d16fd06b8dce13fe114c09c Mon Sep 17 00:00:00 2001 From: donny Date: Mon, 8 Dec 2025 14:20:23 +0100 Subject: [PATCH 4/4] Update pyproject.toml version --- .../connectors/destination-motherduck/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-integrations/connectors/destination-motherduck/pyproject.toml b/airbyte-integrations/connectors/destination-motherduck/pyproject.toml index c9dea97a3bba..e61f5a044ae2 100644 --- a/airbyte-integrations/connectors/destination-motherduck/pyproject.toml +++ b/airbyte-integrations/connectors/destination-motherduck/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "airbyte-destination-motherduck" -version = "0.1.26" +version = "0.1.28" description = "Destination implementation for MotherDuck." authors = ["Guen Prawiroatmodjo, Simon Späti, Airbyte"] license = "ELv2"