Skip to content

Commit f920f04

Browse files
refactor: move check_config_during_discover to BaseConnector class
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 24a0919 commit f920f04

File tree

3 files changed

+12
-26
lines changed

3 files changed

+12
-26
lines changed

airbyte_cdk/connector.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ def load_optional_package_file(package: str, filename: str) -> Optional[bytes]:
3333
class BaseConnector(ABC, Generic[TConfig]):
3434
# configure whether the `check_config_against_spec_or_exit()` needs to be called
3535
check_config_against_spec: bool = True
36+
37+
check_config_during_discover: bool = False
38+
"""
39+
Determines whether config validation should be skipped during discovery.
40+
41+
By default, config validation is not skipped during discovery. This can be overridden
42+
by sources that can provide catalog information without requiring authentication.
43+
"""
3644

3745
@abstractmethod
3846
def configure(self, config: Mapping[str, Any], temp_dir: str) -> TConfig:

airbyte_cdk/sources/abstract_source.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -324,28 +324,3 @@ def stop_sync_on_stream_failure(self) -> bool:
324324
on the first error seen and emit a single error trace message for that stream.
325325
"""
326326
return False
327-
328-
_check_config_during_discover: bool = False
329-
330-
@property
331-
def check_config_during_discover(self) -> bool:
332-
"""
333-
Determines whether config validation should be skipped during discovery.
334-
335-
By default, config validation is not skipped during discovery. This can be overridden
336-
by sources that can provide catalog information without requiring authentication.
337-
338-
Returns:
339-
bool: True if config validation should be skipped during discovery, False otherwise.
340-
"""
341-
return self._check_config_during_discover
342-
343-
@check_config_during_discover.setter
344-
def check_config_during_discover(self, value: bool) -> None:
345-
"""
346-
Sets whether config validation should be skipped during discovery.
347-
348-
Args:
349-
value: True if config validation should be skipped during discovery, False otherwise.
350-
"""
351-
self._check_config_during_discover = value

unit_tests/sources/declarative/test_manifest_declarative_source_dynamic_schema.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#
2+
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
23
#
34

5+
"""Tests for the ManifestDeclarativeSource with DynamicSchemaLoader."""
6+
47
from unittest.mock import MagicMock, patch
58

69
import pytest
@@ -65,7 +68,7 @@ def test_check_config_during_discover_without_dynamic_schema_loader():
6568
}
6669

6770
source = ManifestDeclarativeSource(source_config=source_config)
68-
71+
6972
assert source.check_config_during_discover is False
7073
assert source.check_config_against_spec is True
7174

0 commit comments

Comments
 (0)