Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions airbyte_cdk/sources/utils/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

try:
from jsonschema.validators import Validator
except:
from jsonschema import Validator
except ImportError:
from jsonschema.protocols import Validator
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback import path may be incorrect. The original code imported from jsonschema directly, but the new fallback imports from jsonschema.protocols. If jsonschema.validators is unavailable, jsonschema.protocols might also be unavailable in older versions. Consider falling back to from jsonschema import Validator to maintain backward compatibility.

Suggested change
from jsonschema.protocols import Validator
from jsonschema import Validator

Copilot uses AI. Check for mistakes.



MAX_NESTING_DEPTH = 3
Expand Down
20 changes: 19 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,25 @@ log_cli_format = %(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno
log_cli_date_format=%Y-%m-%d %H:%M:%S
addopts = --junit-xml=build/test-results/pytest-results.xml
filterwarnings =
ignore::airbyte_cdk.sources.source.ExperimentalClassWarning
# Treat python warnings as errors in pytest (following PyAirbyte pattern)
error
# Ignore these specific warnings that are expected/acceptable:

# CDK experimental features - already in use, safe to ignore
# Occurs in: airbyte_cdk/sources/declarative/resolvers/config_components_resolver.py:46
ignore:This class is experimental. Use at your own risk.

# IncrementalMixin deprecation warnings - deprecated as of CDK v0.87.0 in favor of CheckpointMixin
# Occurs in: airbyte_cdk/sources/file_based/stream/default_file_based_stream.py:43
# Occurs in: unit_tests/sources/mock_server_tests/mock_source_fixture.py:65
ignore:Deprecated as of CDK version 0.87.0. Deprecated in favor of the `CheckpointMixin`:DeprecationWarning

# jsonschema import deprecation - Validator should be imported from jsonschema.protocols instead
# Occurs in: airbyte_cdk/sources/utils/transform.py:23
ignore:Importing Validator directly from the jsonschema package is deprecated:DeprecationWarning:airbyte_cdk.sources.utils.transform

# Unknown pytest markers - markers used in tests but not declared in pytest.ini
ignore::pytest.PytestUnknownMarkWarning
markers =
slow: mark tests as slow
asyncio: mark test as asyncio
Expand Down
Loading