From c513ab3340aabad8fdd85954bb3deae263d1556c Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Fri, 21 Mar 2025 13:18:20 -0400 Subject: [PATCH 1/2] remove 1-or-more stream validation --- .../sources/declarative/manifest_declarative_source.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/airbyte_cdk/sources/declarative/manifest_declarative_source.py b/airbyte_cdk/sources/declarative/manifest_declarative_source.py index cfd258c6c..903caf83c 100644 --- a/airbyte_cdk/sources/declarative/manifest_declarative_source.py +++ b/airbyte_cdk/sources/declarative/manifest_declarative_source.py @@ -283,13 +283,6 @@ def _validate_source(self) -> None: f"Failed to read manifest component json schema required for validation: {e}" ) - streams = self._source_config.get("streams") - dynamic_streams = self._source_config.get("dynamic_streams") - if not (streams or dynamic_streams): - raise ValidationError( - f"A valid manifest should have at least one stream defined. Got {streams}" - ) - try: validate(self._source_config, declarative_component_schema) except ValidationError as e: From 530824191548a51dc7b7e55635d5ff799f5f2d49 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Thu, 24 Apr 2025 11:36:23 -0400 Subject: [PATCH 2/2] remove non-applicable unit test --- .../test_manifest_declarative_source.py | 40 ------------------- 1 file changed, 40 deletions(-) diff --git a/unit_tests/sources/declarative/test_manifest_declarative_source.py b/unit_tests/sources/declarative/test_manifest_declarative_source.py index 519bd0955..d6de73db8 100644 --- a/unit_tests/sources/declarative/test_manifest_declarative_source.py +++ b/unit_tests/sources/declarative/test_manifest_declarative_source.py @@ -1015,46 +1015,6 @@ def test_source_with_no_external_spec_and_no_in_yaml_spec_fails(self): with pytest.raises(FileNotFoundError): source.spec(logger) - def test_manifest_without_at_least_one_stream(self): - manifest = { - "version": "0.29.3", - "definitions": { - "schema_loader": { - "name": "{{ parameters.stream_name }}", - "file_path": "./source_sendgrid/schemas/{{ parameters.name }}.yaml", - }, - "retriever": { - "paginator": { - "type": "DefaultPaginator", - "page_size": 10, - "page_size_option": { - "type": "RequestOption", - "inject_into": "request_body", - "field_path": ["variables", "page_size"], - }, - "page_token_option": {"type": "RequestPath"}, - "pagination_strategy": { - "type": "CursorPagination", - "cursor_value": "{{ response._metadata.next }}", - }, - }, - "requester": { - "path": "/v3/marketing/lists", - "authenticator": { - "type": "BearerAuthenticator", - "api_token": "{{ config.apikey }}", - }, - "request_parameters": {"page_size": 10}, - }, - "record_selector": {"extractor": {"field_path": ["result"]}}, - }, - }, - "streams": [], - "check": {"type": "CheckStream", "stream_names": ["lists"]}, - } - with pytest.raises(ValidationError): - ManifestDeclarativeSource(source_config=manifest) - @patch("airbyte_cdk.sources.declarative.declarative_source.DeclarativeSource.read") def test_given_debug_when_read_then_set_log_level(self, declarative_source_read): any_valid_manifest = {