Skip to content

Commit 47bd67c

Browse files
style: fix formatting issues
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent 9e84e1c commit 47bd67c

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

airbyte_cdk/entrypoint.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ def run(self, parsed_args: argparse.Namespace) -> Iterable[str]:
147147
]
148148
yield self.airbyte_message_to_string(message)
149149
else:
150-
if cmd == "discover" and not parsed_args.config and not self.source.check_config_against_spec:
150+
if (
151+
cmd == "discover"
152+
and not parsed_args.config
153+
and not self.source.check_config_against_spec
154+
):
151155
empty_config = {}
152156
yield from [
153157
self.airbyte_message_to_string(queued_message)

unit_tests/sources/declarative/test_manifest_declarative_source_dynamic_schema.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from unittest.mock import MagicMock, patch
55

66
import pytest
7+
78
from airbyte_cdk.models import AirbyteCatalog
89
from airbyte_cdk.sources.declarative.manifest_declarative_source import ManifestDeclarativeSource
910
from airbyte_cdk.sources.utils.schema_helpers import check_config_against_spec_or_exit
@@ -65,18 +66,20 @@ def test_check_config_against_spec_without_dynamic_schema_loader():
6566
source = ManifestDeclarativeSource(source_config=source_config)
6667

6768

68-
@patch("airbyte_cdk.sources.declarative.manifest_declarative_source.ManifestDeclarativeSource.streams")
69+
@patch(
70+
"airbyte_cdk.sources.declarative.manifest_declarative_source.ManifestDeclarativeSource.streams"
71+
)
6972
def test_discover_with_dynamic_schema_loader_no_config(mock_streams):
7073
"""Test that discovery works without config when DynamicSchemaLoader is used."""
7174
mock_stream = MagicMock()
7275
mock_stream.name = "test_dynamic_stream"
73-
76+
7477
mock_airbyte_stream = MagicMock()
7578
type(mock_airbyte_stream).name = "test_dynamic_stream"
7679
mock_stream.as_airbyte_stream.return_value = mock_airbyte_stream
77-
80+
7881
mock_streams.return_value = [mock_stream]
79-
82+
8083
source_config = {
8184
"type": "DeclarativeSource",
8285
"check": {"type": "CheckStream"},
@@ -103,31 +106,33 @@ def test_discover_with_dynamic_schema_loader_no_config(mock_streams):
103106
],
104107
"version": "0.1.0",
105108
}
106-
109+
107110
source = ManifestDeclarativeSource(source_config=source_config)
108-
111+
109112
assert source.check_config_against_spec is False
110-
113+
111114
logger = MagicMock()
112115
catalog = source.discover(logger, {})
113-
116+
114117
assert isinstance(catalog, AirbyteCatalog)
115118
assert len(catalog.streams) == 1
116119
assert catalog.streams[0].name == "test_dynamic_stream"
117120

118121

119-
@patch("airbyte_cdk.sources.declarative.manifest_declarative_source.ManifestDeclarativeSource.streams")
122+
@patch(
123+
"airbyte_cdk.sources.declarative.manifest_declarative_source.ManifestDeclarativeSource.streams"
124+
)
120125
def test_discover_without_dynamic_schema_loader_no_config(mock_streams):
121126
"""Test that discovery validates config when DynamicSchemaLoader is not used."""
122127
mock_stream = MagicMock()
123128
mock_stream.name = "test_static_stream"
124-
129+
125130
mock_airbyte_stream = MagicMock()
126131
type(mock_airbyte_stream).name = "test_static_stream"
127132
mock_stream.as_airbyte_stream.return_value = mock_airbyte_stream
128-
133+
129134
mock_streams.return_value = [mock_stream]
130-
135+
131136
source_config = {
132137
"type": "DeclarativeSource",
133138
"check": {"type": "CheckStream"},
@@ -144,14 +149,14 @@ def test_discover_without_dynamic_schema_loader_no_config(mock_streams):
144149
],
145150
"version": "0.1.0",
146151
}
147-
152+
148153
source = ManifestDeclarativeSource(source_config=source_config)
149-
154+
150155
assert source.check_config_against_spec is True
151-
156+
152157
logger = MagicMock()
153158
catalog = source.discover(logger, {})
154-
159+
155160
assert isinstance(catalog, AirbyteCatalog)
156161
assert len(catalog.streams) == 1
157162
assert catalog.streams[0].name == "test_static_stream"

0 commit comments

Comments
 (0)