Skip to content

Commit 24a0919

Browse files
fix: resolve MyPy type checking issues with check_config_during_discover property
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent dce4f8c commit 24a0919

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

airbyte_cdk/sources/abstract_source.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ def stop_sync_on_stream_failure(self) -> bool:
325325
"""
326326
return False
327327

328+
_check_config_during_discover: bool = False
329+
328330
@property
329331
def check_config_during_discover(self) -> bool:
330332
"""
@@ -336,4 +338,14 @@ def check_config_during_discover(self) -> bool:
336338
Returns:
337339
bool: True if config validation should be skipped during discovery, False otherwise.
338340
"""
339-
return False
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

airbyte_cdk/sources/declarative/manifest_declarative_source.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
)
4848
from airbyte_cdk.sources.declarative.resolvers import COMPONENTS_RESOLVER_TYPE_MAPPING
4949
from airbyte_cdk.sources.message import MessageRepository
50+
from airbyte_cdk.sources.source import Source
5051
from airbyte_cdk.sources.streams.core import Stream
5152
from airbyte_cdk.sources.types import ConnectionDefinition
5253
from airbyte_cdk.sources.utils.slice_logger import (
@@ -108,9 +109,10 @@ def __init__(
108109

109110
self._config = config or {}
110111
self._validate_source()
111-
112-
self.check_config_during_discover = self._uses_dynamic_schema_loader()
112+
113113
self.check_config_against_spec = True
114+
115+
self.check_config_during_discover = self._uses_dynamic_schema_loader()
114116

115117
@property
116118
def resolved_manifest(self) -> Mapping[str, Any]:

0 commit comments

Comments
 (0)