Skip to content

Commit d69dff3

Browse files
feat: remove 1-or-more stream validation (#496)
1 parent 2f29eff commit d69dff3

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

airbyte_cdk/sources/declarative/manifest_declarative_source.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,6 @@ def _validate_source(self) -> None:
283283
f"Failed to read manifest component json schema required for validation: {e}"
284284
)
285285

286-
streams = self._source_config.get("streams")
287-
dynamic_streams = self._source_config.get("dynamic_streams")
288-
if not (streams or dynamic_streams):
289-
raise ValidationError(
290-
f"A valid manifest should have at least one stream defined. Got {streams}"
291-
)
292-
293286
try:
294287
validate(self._source_config, declarative_component_schema)
295288
except ValidationError as e:

unit_tests/sources/declarative/test_manifest_declarative_source.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,46 +1015,6 @@ def test_source_with_no_external_spec_and_no_in_yaml_spec_fails(self):
10151015
with pytest.raises(FileNotFoundError):
10161016
source.spec(logger)
10171017

1018-
def test_manifest_without_at_least_one_stream(self):
1019-
manifest = {
1020-
"version": "0.29.3",
1021-
"definitions": {
1022-
"schema_loader": {
1023-
"name": "{{ parameters.stream_name }}",
1024-
"file_path": "./source_sendgrid/schemas/{{ parameters.name }}.yaml",
1025-
},
1026-
"retriever": {
1027-
"paginator": {
1028-
"type": "DefaultPaginator",
1029-
"page_size": 10,
1030-
"page_size_option": {
1031-
"type": "RequestOption",
1032-
"inject_into": "request_body",
1033-
"field_path": ["variables", "page_size"],
1034-
},
1035-
"page_token_option": {"type": "RequestPath"},
1036-
"pagination_strategy": {
1037-
"type": "CursorPagination",
1038-
"cursor_value": "{{ response._metadata.next }}",
1039-
},
1040-
},
1041-
"requester": {
1042-
"path": "/v3/marketing/lists",
1043-
"authenticator": {
1044-
"type": "BearerAuthenticator",
1045-
"api_token": "{{ config.apikey }}",
1046-
},
1047-
"request_parameters": {"page_size": 10},
1048-
},
1049-
"record_selector": {"extractor": {"field_path": ["result"]}},
1050-
},
1051-
},
1052-
"streams": [],
1053-
"check": {"type": "CheckStream", "stream_names": ["lists"]},
1054-
}
1055-
with pytest.raises(ValidationError):
1056-
ManifestDeclarativeSource(source_config=manifest)
1057-
10581018
@patch("airbyte_cdk.sources.declarative.declarative_source.DeclarativeSource.read")
10591019
def test_given_debug_when_read_then_set_log_level(self, declarative_source_read):
10601020
any_valid_manifest = {

0 commit comments

Comments
 (0)