Skip to content

Commit 6ca213c

Browse files
refactor: push check_config_during_discover flag into connector base class
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 77772c3 commit 6ca213c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

airbyte_cdk/entrypoint.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,7 @@ def discover(
241241
self, source_spec: ConnectorSpecification, config: TConfig
242242
) -> Iterable[AirbyteMessage]:
243243
self.set_up_secret_filter(config, source_spec.connectionSpecification)
244-
if (
245-
not hasattr(self.source, "check_config_during_discover")
246-
or not self.source.check_config_during_discover
247-
):
244+
if not self.source.check_config_during_discover:
248245
self.validate_connection(source_spec, config)
249246
catalog = self.source.discover(self.logger, config)
250247

airbyte_cdk/sources/abstract_source.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,16 @@ 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+
@property
329+
def check_config_during_discover(self) -> bool:
330+
"""
331+
Determines whether config validation should be skipped during discovery.
332+
333+
By default, config validation is not skipped during discovery. This can be overridden
334+
by sources that can provide catalog information without requiring authentication.
335+
336+
Returns:
337+
bool: True if config validation should be skipped during discovery, False otherwise.
338+
"""
339+
return False

0 commit comments

Comments
 (0)