From 29cfd203f7ce3e9bd0083387f3558a6cd4040070 Mon Sep 17 00:00:00 2001 From: pnilan Date: Fri, 27 Jun 2025 11:20:49 -0700 Subject: [PATCH 1/3] fix: adds validators, validation strategies to init --- airbyte_cdk/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/airbyte_cdk/__init__.py b/airbyte_cdk/__init__.py index 262d162cc..3e95c8367 100644 --- a/airbyte_cdk/__init__.py +++ b/airbyte_cdk/__init__.py @@ -129,6 +129,7 @@ from .sources.declarative.transformations.add_fields import AddedFieldDefinition, AddFields from .sources.declarative.transformations.transformation import RecordTransformation from .sources.declarative.types import FieldPointer +from .sources.declarative.validators import DpathValidator, PredicateValidator, ValidateAdheresToSchema, ValidationStrategy, Validator from .sources.declarative.yaml_declarative_source import YamlDeclarativeSource from .sources.message import InMemoryMessageRepository, MessageRepository from .sources.source import TState @@ -339,6 +340,12 @@ "Record", "Source", "StreamSlice", + # Validators + "Validator", + "DpathValidator", + "PredicateValidator", + "ValidationStrategy", + "ValidateAdheresToSchema", ] __version__: str From 4071bc3a9c0b417bc73e97478403489326f346c9 Mon Sep 17 00:00:00 2001 From: pnilan Date: Fri, 27 Jun 2025 15:12:59 -0700 Subject: [PATCH 2/3] update log in dpath --- airbyte_cdk/sources/declarative/validators/dpath_validator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airbyte_cdk/sources/declarative/validators/dpath_validator.py b/airbyte_cdk/sources/declarative/validators/dpath_validator.py index 8b1452c9c..f83e908a4 100644 --- a/airbyte_cdk/sources/declarative/validators/dpath_validator.py +++ b/airbyte_cdk/sources/declarative/validators/dpath_validator.py @@ -53,7 +53,7 @@ def validate(self, input_data: dict[str, Any]) -> None: for value in values: self.strategy.validate(value) except KeyError as e: - logger.warning(f"Error validating path. Key not found: {e}") + logger.info(f"Validation skipped. Key not found: {e}") return else: @@ -61,5 +61,5 @@ def validate(self, input_data: dict[str, Any]) -> None: value = dpath.get(input_data, path) self.strategy.validate(value) except KeyError as e: - logger.warning(f"Error validating path. Key not found: {e}") + logger.info(f"Validation skipped. Key not found: {e}") return From 270902a95aa440ba68488fae3476f03a96dbe801 Mon Sep 17 00:00:00 2001 From: pnilan Date: Fri, 27 Jun 2025 15:14:27 -0700 Subject: [PATCH 3/3] revert init --- airbyte_cdk/__init__.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/airbyte_cdk/__init__.py b/airbyte_cdk/__init__.py index 3e95c8367..262d162cc 100644 --- a/airbyte_cdk/__init__.py +++ b/airbyte_cdk/__init__.py @@ -129,7 +129,6 @@ from .sources.declarative.transformations.add_fields import AddedFieldDefinition, AddFields from .sources.declarative.transformations.transformation import RecordTransformation from .sources.declarative.types import FieldPointer -from .sources.declarative.validators import DpathValidator, PredicateValidator, ValidateAdheresToSchema, ValidationStrategy, Validator from .sources.declarative.yaml_declarative_source import YamlDeclarativeSource from .sources.message import InMemoryMessageRepository, MessageRepository from .sources.source import TState @@ -340,12 +339,6 @@ "Record", "Source", "StreamSlice", - # Validators - "Validator", - "DpathValidator", - "PredicateValidator", - "ValidationStrategy", - "ValidateAdheresToSchema", ] __version__: str