Skip to content

Support user-specified test read limits in connector_builder code #35312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions airbyte-cdk/python/airbyte_cdk/connector_builder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Note:
*See [ConnectionSpecification](https://docs.airbyte.com/understanding-airbyte/airbyte-protocol/#actor-specification) for details on the `"config"` key if needed.

- When the `__command` is `resolve_manifest`, the argument to `catalog` should be an empty string.
- The config can optionally contain an object under the `__test_read_config` key which can define custom test read limits with `max_records`, `max_slices`, and `max_pages_per_slice` properties. All custom limits are optional; a default will be used for any limit that is not provided.

### Locally running the docker image

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def get_message_groups(
configured_catalog: ConfiguredAirbyteCatalog,
record_limit: Optional[int] = None,
) -> StreamRead:
if record_limit is not None and not (1 <= record_limit <= 1000):
raise ValueError(f"Record limit must be between 1 and 1000. Got {record_limit}")
if record_limit is not None and not (1 <= record_limit <= self._max_record_limit):
raise ValueError(f"Record limit must be between 1 and {self._max_record_limit}. Got {record_limit}")
schema_inferrer = SchemaInferrer()
datetime_format_inferrer = DatetimeFormatInferrer()

Expand Down