Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def __init__(
concurrency_level_component = self._constructor.create_component(
model_type=ConcurrencyLevelModel,
component_definition=concurrency_level_from_manifest,
config=config or {},
config=self._config,
)
if not isinstance(concurrency_level_component, ConcurrencyLevel):
raise ValueError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,42 @@ def test_concurrency_level_initial_number_partitions_to_generate_is_always_one_o
assert source._concurrent_source._initial_number_partitions_to_generate == 1


_SET_NUM_WORKERS_TO_4 = {
"type": "ConfigAddFields",
"fields": [{"type": "AddedFieldDefinition", "path": ["num_workers"], "value": "4"}],
}


@pytest.mark.parametrize(
"config_normalization_rules",
[
pytest.param(
{
"config_migrations": [
{"type": "ConfigMigration", "transformations": [_SET_NUM_WORKERS_TO_4]}
]
},
id="config_migrations",
),
pytest.param({"transformations": [_SET_NUM_WORKERS_TO_4]}, id="transformations"),
],
)
def test_concurrency_level_uses_normalized_config(config_normalization_rules):
manifest = copy.deepcopy(_MANIFEST)
manifest["spec"] = {
"type": "Spec",
"connection_specification": {},
"config_normalization_rules": {
"type": "ConfigNormalizationRules",
**config_normalization_rules,
},
}

source = ConcurrentDeclarativeSource(source_config=manifest, config={"num_workers": 1})

assert source._concurrent_source._threadpool._threadpool._max_workers == 4


def test_async_incremental_stream_uses_concurrent_cursor_with_state():
state = [
AirbyteStateMessage(
Expand Down
Loading