Skip to content

Commit 061de78

Browse files
Merge branch 'devin/1756425696-jsonschema-version-pin' of https://git-manager.devin.ai/proxy/github.com/airbytehq/airbyte-python-cdk into devin/1756425696-jsonschema-version-pin
2 parents 5d75886 + d14cd84 commit 061de78

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

airbyte_cdk/connector_builder/connector_builder_handler.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ def should_normalize_manifest(config: Mapping[str, Any]) -> bool:
6262

6363
def create_source(
6464
config: Mapping[str, Any],
65-
limits: TestLimits,
66-
catalog: Optional[ConfiguredAirbyteCatalog],
67-
state: Optional[List[AirbyteStateMessage]],
65+
limits: TestLimits | None = None,
66+
catalog: ConfiguredAirbyteCatalog | None = None,
67+
state: List[AirbyteStateMessage] | None = None,
6868
) -> ConcurrentDeclarativeSource[Optional[List[AirbyteStateMessage]]]:
6969
manifest = config["__injected_declarative_manifest"]
70+
catalog = catalog or None
71+
state = state or []
7072

7173
# We enforce a concurrency level of 1 so that the stream is processed on a single thread
7274
# to retain ordering for the grouping of the builder message responses.

airbyte_cdk/connector_builder/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ def handle_connector_builder_request(
9393
def handle_request(args: List[str]) -> str:
9494
command, config, catalog, state = get_config_and_catalog_from_args(args)
9595
limits = get_limits(config)
96-
source = create_source(config=config, limits=limits, catalog=catalog, state=state)
96+
source = create_source(
97+
config=config,
98+
limits=limits,
99+
catalog=catalog,
100+
state=state,
101+
)
97102
return orjson.dumps( # type: ignore[no-any-return] # Serializer.dump() always returns AirbyteMessage
98103
AirbyteMessageSerializer.dump(
99104
handle_connector_builder_request(source, command, config, catalog, state, limits)

unit_tests/connector_builder/test_connector_builder_handler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,12 @@ def test_handle_429_response():
901901

902902
limits = TestLimits()
903903
catalog = ConfiguredAirbyteCatalogSerializer.load(CONFIGURED_CATALOG)
904-
source = create_source(config=config, limits=limits, catalog=catalog, state=None)
904+
source = create_source(
905+
config=config,
906+
limits=limits,
907+
catalog=catalog,
908+
state=None,
909+
)
905910

906911
with patch("requests.Session.send", return_value=response) as mock_send:
907912
response = handle_connector_builder_request(

0 commit comments

Comments
 (0)