Skip to content

Commit 4fd5473

Browse files
committed
fix different stream checking logic and add parameter to async retriever
1 parent bd00b8a commit 4fd5473

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

airbyte_cdk/connector_builder/test_reader/helpers.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,14 @@ def is_page_http_request_for_different_stream(
288288
Returns:
289289
bool: True if the JSON message is a page HTTP request for a different stream, False otherwise.
290290
"""
291-
return (
292-
json_message is not None
293-
and is_page_http_request(json_message)
294-
and json_message.get("airbyte_cdk", {}).get("stream", {}).get("name", "") != stream_name
295-
)
291+
if not json_message or not is_page_http_request(json_message):
292+
return False
293+
294+
message_stream_name = json_message.get("airbyte_cdk", {}).get("stream", {}).get("name", None)
295+
if message_stream_name is None:
296+
return False
297+
298+
return message_stream_name != stream_name
296299

297300

298301
def is_page_http_request(json_message: Optional[Dict[str, Any]]) -> bool:

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3858,6 +3858,7 @@ def create_config_components_resolver(
38583858
self,
38593859
model: ConfigComponentsResolverModel,
38603860
config: Config,
3861+
stream_name: Optional[str] = None,
38613862
) -> Any:
38623863
model_stream_configs = (
38633864
model.stream_config if isinstance(model.stream_config, list) else [model.stream_config]

0 commit comments

Comments
 (0)