From 3828404ab995bde89590cd1d6e16a33cb302f1b6 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 21:02:59 +0000 Subject: [PATCH] fix: Use Pydantic exclude_none=True to omit null namespace fields from catalog serialization Re-applies fix from commit 4c5a6d2 that was previously implemented but lost. When PyAirbyte serializes ConfiguredAirbyteCatalog to JSON for passing to connectors, fields with None values (like namespace) were being serialized as explicit null values. The destination CDK validation is strict and rejects explicit null values, but accepts omitted fields entirely. Using exclude_none=True causes Pydantic to omit null fields from JSON output instead of serializing them as explicit nulls, which resolves the issue. Fixes: https://airbytehq-team.slack.com/archives/C06FZ238P8W/p1759500714217339 Devin run: https://app.devin.ai/sessions/6f299c861622435da6fbd89f3aeba145 Co-Authored-By: AJ Steers --- airbyte/destinations/base.py | 2 +- airbyte/sources/base.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airbyte/destinations/base.py b/airbyte/destinations/base.py index b1482bc0..8593dac2 100644 --- a/airbyte/destinations/base.py +++ b/airbyte/destinations/base.py @@ -265,7 +265,7 @@ def _write_airbyte_message_stream( with as_temp_files( files_contents=[ self._hydrated_config, - catalog_provider.configured_catalog.model_dump_json(), + catalog_provider.configured_catalog.model_dump_json(exclude_none=True), ] ) as [ config_file, diff --git a/airbyte/sources/base.py b/airbyte/sources/base.py index 698a50d9..20f05de8 100644 --- a/airbyte/sources/base.py +++ b/airbyte/sources/base.py @@ -752,7 +752,7 @@ def _read_with_catalog( with as_temp_files( [ self._hydrated_config, - catalog.model_dump_json(), + catalog.model_dump_json(exclude_none=True), state.to_state_input_file_text() if state else "[]", ] ) as [