Skip to content

Commit 6fef39b

Browse files
author
maxime.c
committed
mypy and format
1 parent ebb4b28 commit 6fef39b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

airbyte_cdk/connector_builder/test_reader/reader.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ def run_test_read(
120120
deprecation_warnings: List[LogMessage] = source.deprecation_warnings()
121121

122122
schema_inferrer = SchemaInferrer(
123-
self._pk_to_nested_and_composite_field(stream.primary_key if hasattr(stream, "primary_key") else stream._primary_key) if stream else None,
123+
self._pk_to_nested_and_composite_field(
124+
stream.primary_key if hasattr(stream, "primary_key") else stream._primary_key
125+
)
126+
if stream
127+
else None, # type: ignore # We are accessing the private property here as the primary key is not exposed. We should either expose it or use `as_airbyte_stream` to retrieve it as this is the "official" way where it is exposed in the Airbyte protocol
124128
self._cursor_field_to_nested_and_composite_field(stream.cursor_field)
125129
if stream
126130
else None,

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,10 +2069,7 @@ def create_declarative_stream(
20692069
options["name"] = model.name
20702070
schema_loader = DefaultSchemaLoader(config=config, parameters=options)
20712071

2072-
if (
2073-
isinstance(combined_slicers, PartitionRouter)
2074-
and not is_parent
2075-
):
2072+
if isinstance(combined_slicers, PartitionRouter) and not is_parent:
20762073
# We are starting to migrate streams to instantiate directly the DefaultStream instead of instantiating the
20772074
# DeclarativeStream and assembling the DefaultStream from that. The plan is the following:
20782075
# * Streams without partition router nor cursors and streams with only partition router. This is the `isinstance(combined_slicers, PartitionRouter)` condition as the first kind with have a SinglePartitionRouter

0 commit comments

Comments
 (0)