From d593a4b870ef8c7e0aad69b3260ecabd5598005b Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 6 Jun 2026 03:33:52 +0000 Subject: [PATCH 1/2] test: repro MyPy CI failures from main (do not merge) Co-Authored-By: AJ Steers --- mypy.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/mypy.ini b/mypy.ini index ff616f462..6d7080ad0 100644 --- a/mypy.ini +++ b/mypy.ini @@ -25,3 +25,4 @@ plugins = ["pydantic.mypy", "pytest-mypy-plugins"] [mypy-airbyte_cdk.models] ignore_errors = True + From 66dd637a4a7181468435318fd4d2732d18ddbdea Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 6 Jun 2026 03:36:59 +0000 Subject: [PATCH 2/2] fix: resolve MyPy type check failures Co-Authored-By: AJ Steers --- .../connector_builder/connector_builder_handler.py | 4 ++-- .../manifest_server/command_processor/utils.py | 4 ++-- .../file_based/stream/default_file_based_stream.py | 2 +- .../sources/streams/checkpoint/checkpoint_reader.py | 13 +++++++------ 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/airbyte_cdk/connector_builder/connector_builder_handler.py b/airbyte_cdk/connector_builder/connector_builder_handler.py index e63c200c1..2e5a00eeb 100644 --- a/airbyte_cdk/connector_builder/connector_builder_handler.py +++ b/airbyte_cdk/connector_builder/connector_builder_handler.py @@ -48,7 +48,7 @@ def should_migrate_manifest(config: Mapping[str, Any]) -> bool: This flag is set by the UI. """ - return config.get("__should_migrate", False) + return bool(config.get("__should_migrate", False)) def should_normalize_manifest(config: Mapping[str, Any]) -> bool: @@ -57,7 +57,7 @@ def should_normalize_manifest(config: Mapping[str, Any]) -> bool: :param config: The configuration to check :return: True if the manifest should be normalized, False otherwise. """ - return config.get("__should_normalize", False) + return bool(config.get("__should_normalize", False)) def create_source( diff --git a/airbyte_cdk/manifest_server/command_processor/utils.py b/airbyte_cdk/manifest_server/command_processor/utils.py index 2f8b3c30f..f9eed42c5 100644 --- a/airbyte_cdk/manifest_server/command_processor/utils.py +++ b/airbyte_cdk/manifest_server/command_processor/utils.py @@ -42,7 +42,7 @@ def should_migrate_manifest(manifest: Mapping[str, Any]) -> bool: This flag is set by the UI. """ - return manifest.get(SHOULD_MIGRATE_KEY, False) + return bool(manifest.get(SHOULD_MIGRATE_KEY, False)) def should_normalize_manifest(manifest: Mapping[str, Any]) -> bool: @@ -52,7 +52,7 @@ def should_normalize_manifest(manifest: Mapping[str, Any]) -> bool: This flag is set by the UI. """ - return manifest.get(SHOULD_NORMALIZE_KEY, False) + return bool(manifest.get(SHOULD_NORMALIZE_KEY, False)) def build_source( diff --git a/airbyte_cdk/sources/file_based/stream/default_file_based_stream.py b/airbyte_cdk/sources/file_based/stream/default_file_based_stream.py index 588c4a18e..3466b48d4 100644 --- a/airbyte_cdk/sources/file_based/stream/default_file_based_stream.py +++ b/airbyte_cdk/sources/file_based/stream/default_file_based_stream.py @@ -93,7 +93,7 @@ def state(self, value: MutableMapping[str, Any]) -> None: def cursor(self) -> Optional[AbstractFileBasedCursor]: return self._cursor - @cursor.setter + @cursor.setter # type: ignore[override] def cursor(self, value: AbstractFileBasedCursor) -> None: if self._cursor is not None: raise RuntimeError( diff --git a/airbyte_cdk/sources/streams/checkpoint/checkpoint_reader.py b/airbyte_cdk/sources/streams/checkpoint/checkpoint_reader.py index 6e4ef98d7..e14e69389 100644 --- a/airbyte_cdk/sources/streams/checkpoint/checkpoint_reader.py +++ b/airbyte_cdk/sources/streams/checkpoint/checkpoint_reader.py @@ -245,11 +245,12 @@ def __init__( def next(self) -> Optional[Mapping[str, Any]]: try: - self.current_slice = self._find_next_slice() + current = self._find_next_slice() + self.current_slice = current - if "partition" in dict(self.current_slice): + if "partition" in dict(current): raise ValueError("Stream is configured to use invalid stream slice key 'partition'") - elif "cursor_slice" in dict(self.current_slice): + elif "cursor_slice" in dict(current): raise ValueError( "Stream is configured to use invalid stream slice key 'cursor_slice'" ) @@ -257,9 +258,9 @@ def next(self) -> Optional[Mapping[str, Any]]: # We convert StreamSlice to a regular mapping because legacy connectors operate on the basic Mapping object. We # also duplicate all fields at the top level for backwards compatibility for existing Python sources return { - "partition": self.current_slice.partition, - "cursor_slice": self.current_slice.cursor_slice, - **dict(self.current_slice), + "partition": current.partition, + "cursor_slice": current.cursor_slice, + **dict(current), } except StopIteration: self._finished_sync = True