Skip to content

Commit 9eca3a2

Browse files
committed
renames
1 parent 039cbbf commit 9eca3a2

File tree

7 files changed

+156
-170
lines changed

7 files changed

+156
-170
lines changed

airbyte_cdk/manifest_runner/manifest_runner/__init__.py renamed to airbyte_cdk/manifest_runner/command_processor/__init__.py

File renamed without changes.

airbyte_cdk/manifest_runner/manifest_runner/runner.py renamed to airbyte_cdk/manifest_runner/command_processor/processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
)
2323

2424

25-
class ManifestRunner:
25+
class ManifestCommandProcessor:
2626
_source: ManifestDeclarativeSource
2727
_logger = logging.getLogger("airbyte.manifest-runner")
2828

File renamed without changes.

airbyte_cdk/manifest_runner/routers/manifest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
StreamTestReadRequest,
2626
)
2727
from ..auth import verify_jwt_token
28-
from ..manifest_runner.runner import ManifestRunner
29-
from ..manifest_runner.utils import build_catalog, build_source
28+
from ..command_processor.processor import ManifestCommandProcessor
29+
from ..command_processor.utils import build_catalog, build_source
3030

3131

3232
def safe_build_source(manifest_dict, config_dict):
@@ -61,7 +61,7 @@ def test_read(request: StreamTestReadRequest) -> StreamRead:
6161
"md5": hashlib.md5(request.custom_components_code.encode()).hexdigest()
6262
}
6363

64-
runner = ManifestRunner(source)
64+
runner = ManifestCommandProcessor(source)
6565
cdk_result = runner.test_read(
6666
config_dict,
6767
catalog,
@@ -77,7 +77,7 @@ def test_read(request: StreamTestReadRequest) -> StreamRead:
7777
def check(request: CheckRequest) -> CheckResponse:
7878
"""Check configuration against a manifest"""
7979
source = safe_build_source(request.manifest.model_dump(), request.config.model_dump())
80-
runner = ManifestRunner(source)
80+
runner = ManifestCommandProcessor(source)
8181
success, message = runner.check_connection(request.config.model_dump())
8282
return CheckResponse(success=success, message=message)
8383

@@ -86,7 +86,7 @@ def check(request: CheckRequest) -> CheckResponse:
8686
def discover(request: DiscoverRequest) -> DiscoverResponse:
8787
"""Discover streams from a manifest"""
8888
source = safe_build_source(request.manifest.model_dump(), request.config.model_dump())
89-
runner = ManifestRunner(source)
89+
runner = ManifestCommandProcessor(source)
9090
catalog = runner.discover(request.config.model_dump())
9191
if catalog is None:
9292
raise HTTPException(status_code=422, detail="Connector did not return a discovered catalog")

unit_tests/manifest_runner/manifest_runner/test_runner.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
)
1313
from airbyte_protocol_dataclasses.models import Type as AirbyteMessageType
1414

15-
from airbyte_cdk.manifest_runner.manifest_runner.runner import ManifestRunner
15+
from airbyte_cdk.manifest_runner.command_processor.processor import ManifestCommandProcessor
1616

1717

18-
class TestManifestRunner:
19-
"""Test cases for the ManifestRunner class."""
18+
class TestManifestCommandProcessor:
19+
"""Test cases for the ManifestCommandProcessor class."""
2020

2121
@pytest.fixture
2222
def mock_source(self):
@@ -25,8 +25,8 @@ def mock_source(self):
2525

2626
@pytest.fixture
2727
def manifest_runner(self, mock_source):
28-
"""Create a ManifestRunner instance with mocked source."""
29-
return ManifestRunner(mock_source)
28+
"""Create a ManifestCommandProcessor instance with mocked source."""
29+
return ManifestCommandProcessor(mock_source)
3030

3131
@pytest.fixture
3232
def sample_config(self):
@@ -63,7 +63,7 @@ def sample_state(self):
6363
"""Sample state messages for testing."""
6464
return []
6565

66-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.TestReader")
66+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.TestReader")
6767
def test_test_read_success(
6868
self, mock_test_reader_class, manifest_runner, sample_config, sample_catalog
6969
):
@@ -124,7 +124,7 @@ def test_test_read_success(
124124
# Verify the result is returned correctly
125125
assert result == mock_stream_read
126126

127-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.TestReader")
127+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.TestReader")
128128
def test_test_read_exception_handling(
129129
self,
130130
mock_test_reader_class,
@@ -151,7 +151,7 @@ def test_test_read_exception_handling(
151151
slice_limit=10,
152152
)
153153

154-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.AirbyteEntrypoint")
154+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.AirbyteEntrypoint")
155155
def test_check_connection_success(self, mock_entrypoint_class, manifest_runner, sample_config):
156156
"""Test successful check_connection execution."""
157157

@@ -185,7 +185,7 @@ def test_check_connection_success(self, mock_entrypoint_class, manifest_runner,
185185
mock_entrypoint_class.assert_called_once_with(source=manifest_runner._source)
186186
mock_entrypoint_instance.check.assert_called_once()
187187

188-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.AirbyteEntrypoint")
188+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.AirbyteEntrypoint")
189189
def test_check_connection_failure(self, mock_entrypoint_class, manifest_runner, sample_config):
190190
"""Test check_connection with failed status."""
191191

@@ -210,7 +210,7 @@ def test_check_connection_failure(self, mock_entrypoint_class, manifest_runner,
210210
assert success is False
211211
assert message == "Invalid API key"
212212

213-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.AirbyteEntrypoint")
213+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.AirbyteEntrypoint")
214214
def test_check_connection_no_status_message(
215215
self, mock_entrypoint_class, manifest_runner, sample_config
216216
):
@@ -232,7 +232,7 @@ def test_check_connection_no_status_message(
232232
assert success is False
233233
assert message == "Connection check failed"
234234

235-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.AirbyteEntrypoint")
235+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.AirbyteEntrypoint")
236236
def test_check_connection_with_trace_error(
237237
self, mock_entrypoint_class, manifest_runner, sample_config
238238
):
@@ -256,7 +256,7 @@ def test_check_connection_with_trace_error(
256256
with pytest.raises(Exception, match="Authentication failed"):
257257
manifest_runner.check_connection(sample_config)
258258

259-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.AirbyteEntrypoint")
259+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.AirbyteEntrypoint")
260260
def test_discover_success(self, mock_entrypoint_class, manifest_runner, sample_config):
261261
"""Test successful discover execution."""
262262

@@ -295,7 +295,7 @@ def test_discover_success(self, mock_entrypoint_class, manifest_runner, sample_c
295295
mock_entrypoint_class.assert_called_once_with(source=manifest_runner._source)
296296
mock_entrypoint_instance.discover.assert_called_once()
297297

298-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.AirbyteEntrypoint")
298+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.AirbyteEntrypoint")
299299
def test_discover_no_catalog_message(
300300
self, mock_entrypoint_class, manifest_runner, sample_config
301301
):
@@ -316,7 +316,7 @@ def test_discover_no_catalog_message(
316316
# Verify the result is None
317317
assert result is None
318318

319-
@patch("airbyte_cdk.manifest_runner.manifest_runner.runner.AirbyteEntrypoint")
319+
@patch("airbyte_cdk.manifest_runner.command_processor.processor.AirbyteEntrypoint")
320320
def test_discover_with_trace_error(self, mock_entrypoint_class, manifest_runner, sample_config):
321321
"""Test discover raises exception when trace error is present."""
322322

unit_tests/manifest_runner/manifest_runner/test_utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from unittest.mock import Mock, patch
22

3-
from airbyte_cdk.manifest_runner.manifest_runner.utils import (
3+
from airbyte_cdk.manifest_runner.command_processor.utils import (
44
SHOULD_MIGRATE_KEY,
55
SHOULD_NORMALIZE_KEY,
66
build_catalog,
@@ -31,8 +31,8 @@ def test_build_catalog_creates_correct_structure(self):
3131
assert configured_stream.sync_mode == SyncMode.incremental
3232
assert configured_stream.destination_sync_mode == DestinationSyncMode.overwrite
3333

34-
@patch("airbyte_cdk.manifest_runner.manifest_runner.utils.ManifestDeclarativeSource")
35-
@patch("airbyte_cdk.manifest_runner.manifest_runner.utils.ModelToComponentFactory")
34+
@patch("airbyte_cdk.manifest_runner.command_processor.utils.ManifestDeclarativeSource")
35+
@patch("airbyte_cdk.manifest_runner.command_processor.utils.ModelToComponentFactory")
3636
def test_build_source_creates_manifest_declarative_source(
3737
self, mock_component_factory_class, mock_source_class
3838
):
@@ -92,8 +92,8 @@ def test_build_source_creates_manifest_declarative_source(
9292

9393
assert result == mock_source
9494

95-
@patch("airbyte_cdk.manifest_runner.manifest_runner.utils.ManifestDeclarativeSource")
96-
@patch("airbyte_cdk.manifest_runner.manifest_runner.utils.ModelToComponentFactory")
95+
@patch("airbyte_cdk.manifest_runner.command_processor.utils.ManifestDeclarativeSource")
96+
@patch("airbyte_cdk.manifest_runner.command_processor.utils.ModelToComponentFactory")
9797
def test_build_source_with_normalize_flag(
9898
self, mock_component_factory_class, mock_source_class
9999
):
@@ -113,8 +113,8 @@ def test_build_source_with_normalize_flag(
113113
assert call_args["normalize_manifest"] is True
114114
assert call_args["migrate_manifest"] is False
115115

116-
@patch("airbyte_cdk.manifest_runner.manifest_runner.utils.ManifestDeclarativeSource")
117-
@patch("airbyte_cdk.manifest_runner.manifest_runner.utils.ModelToComponentFactory")
116+
@patch("airbyte_cdk.manifest_runner.command_processor.utils.ManifestDeclarativeSource")
117+
@patch("airbyte_cdk.manifest_runner.command_processor.utils.ModelToComponentFactory")
118118
def test_build_source_with_migrate_flag(self, mock_component_factory_class, mock_source_class):
119119
"""Test build_source when migrate flag is set."""
120120
mock_component_factory = Mock()

0 commit comments

Comments
 (0)