Skip to content

Commit ca75f57

Browse files
committed
Merge branch 'main' into 50395-2
* main: fix: update cryptography package to latest version to address CVE (airbytehq#377) fix: (CDK) (HttpRequester) - Make the `HttpRequester.path` optional (airbytehq#370) feat: improved custom components handling (airbytehq#350) feat: add microseconds timestamp format (airbytehq#373) fix: Replace Unidecode with anyascii for permissive license (airbytehq#367) feat: add IncrementingCountCursor (airbytehq#346) feat: (low-code cdk) datetime format with milliseconds (airbytehq#369) fix: (CDK) (AsyncRetriever) - Improve UX on variable naming and interpolation (airbytehq#368) fix: (CDK) (AsyncRetriever) - Add the `request` and `response` to each `async` operations (airbytehq#356) fix: (CDK) (ConnectorBuilder) - Add `auxiliary requests` to slice; support `TestRead` for AsyncRetriever (part 1/2) (airbytehq#355) feat(concurrent perpartition cursor): Add parent state updates (airbytehq#343) fix: update csv parser for builder compatibility (airbytehq#364) feat(low-code cdk): add interpolation for limit field in Rate (airbytehq#353) feat(low-code cdk): add AbstractStreamFacade processing as concurrent streams in declarative source (airbytehq#347) fix: (CDK) (CsvParser) - Fix the `\\` escaping when passing the `delimiter` from Builder's UI (airbytehq#358) feat: expose `str_to_datetime` jinja macro (airbytehq#351) fix: update CDK migration for 6.34.0 (airbytehq#348) feat: Removes `stream_state` interpolation from CDK (airbytehq#320) fix(declarative): Pass `extra_fields` in `global_substream_cursor` (airbytehq#195) feat(concurrent perpartition cursor): Refactor ConcurrentPerPartitionCursor (airbytehq#331) feat(HttpMocker): adding support for PUT requests and bytes responses (airbytehq#342) chore: use certified source for manifest-only test (airbytehq#338) feat: check for request_option mapping conflicts in individual components (airbytehq#328) feat(file-based): sync file acl permissions and identities (airbytehq#260) fix: (CDK) (Connector Builder) - refactor the `MessageGrouper` > `TestRead` (airbytehq#332) fix(low code): Fix missing cursor for ClientSideIncrementalRecordFilterDecorator (airbytehq#334) feat(low-code): Add API Budget (airbytehq#314) chore(decoder): clean decoders and make csvdecoder available (airbytehq#326)
2 parents ceeea8f + 472199f commit ca75f57

File tree

104 files changed

+5477
-1558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+5477
-1558
lines changed

Diff for: .github/workflows/connector-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
# cdk_extra: n/a
8989
# TODO: These are manifest connectors and won't work as expected until we
9090
# add `--use-local-cdk` support for manifest connectors.
91-
- connector: source-the-guardian-api
91+
- connector: source-amplitude
9292
cdk_extra: n/a
9393
- connector: source-pokeapi
9494
cdk_extra: n/a

Diff for: airbyte_cdk/connector_builder/connector_builder_handler.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
33
#
44

5-
import dataclasses
5+
6+
from dataclasses import asdict, dataclass, field
67
from typing import Any, List, Mapping
78

8-
from airbyte_cdk.connector_builder.message_grouper import MessageGrouper
9+
from airbyte_cdk.connector_builder.test_reader import TestReader
910
from airbyte_cdk.models import (
1011
AirbyteMessage,
1112
AirbyteRecordMessage,
@@ -32,11 +33,11 @@
3233
MAX_RECORDS_KEY = "max_records"
3334

3435

35-
@dataclasses.dataclass
36+
@dataclass
3637
class TestReadLimits:
37-
max_records: int = dataclasses.field(default=DEFAULT_MAXIMUM_RECORDS)
38-
max_pages_per_slice: int = dataclasses.field(default=DEFAULT_MAXIMUM_NUMBER_OF_PAGES_PER_SLICE)
39-
max_slices: int = dataclasses.field(default=DEFAULT_MAXIMUM_NUMBER_OF_SLICES)
38+
max_records: int = field(default=DEFAULT_MAXIMUM_RECORDS)
39+
max_pages_per_slice: int = field(default=DEFAULT_MAXIMUM_NUMBER_OF_PAGES_PER_SLICE)
40+
max_slices: int = field(default=DEFAULT_MAXIMUM_NUMBER_OF_SLICES)
4041

4142

4243
def get_limits(config: Mapping[str, Any]) -> TestReadLimits:
@@ -73,17 +74,20 @@ def read_stream(
7374
limits: TestReadLimits,
7475
) -> AirbyteMessage:
7576
try:
76-
handler = MessageGrouper(limits.max_pages_per_slice, limits.max_slices, limits.max_records)
77-
stream_name = configured_catalog.streams[
78-
0
79-
].stream.name # The connector builder only supports a single stream
80-
stream_read = handler.get_message_groups(
77+
test_read_handler = TestReader(
78+
limits.max_pages_per_slice, limits.max_slices, limits.max_records
79+
)
80+
# The connector builder only supports a single stream
81+
stream_name = configured_catalog.streams[0].stream.name
82+
83+
stream_read = test_read_handler.run_test_read(
8184
source, config, configured_catalog, state, limits.max_records
8285
)
86+
8387
return AirbyteMessage(
8488
type=MessageType.RECORD,
8589
record=AirbyteRecordMessage(
86-
data=dataclasses.asdict(stream_read), stream=stream_name, emitted_at=_emitted_at()
90+
data=asdict(stream_read), stream=stream_name, emitted_at=_emitted_at()
8791
),
8892
)
8993
except Exception as exc:

0 commit comments

Comments
 (0)