Skip to content

Commit

Permalink
fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix committed Dec 2, 2022
1 parent c33d6ed commit 39fde94
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions dlt/common/runners/pool_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ def update_gauges() -> TRunHealth:


def run_pool(C: PoolRunnerConfiguration, run_f: Union[Runnable[TPool], Callable[[TPool], TRunMetrics]]) -> int:
# validate run function
if not isinstance(run_f, Runnable) and not callable(run_f):
raise ValueError(run_f, "Pool runner entry point must be a function f(pool: TPool) or Runnable")

# create health gauges
if not HEALTH_PROPS_GAUGES:
create_gauges(REGISTRY)
Expand Down
12 changes: 6 additions & 6 deletions tests/common/runners/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ def test_signal_exception_run() -> None:
"runs_not_idle_count": 0,
"runs_healthy_count": 0,
"runs_cs_healthy_gauge": 0,
"runs_failed_count": 0,
"runs_cs_failed_gauge": 0,
"runs_pending_items_gauge": 0
"runs_failed_count": 1,
"runs_cs_failed_gauge": 1,
"runs_pending_items_gauge": -1
}


Expand All @@ -253,9 +253,9 @@ def test_timerange_exhausted_run() -> None:
"runs_not_idle_count": 0,
"runs_healthy_count": 0,
"runs_cs_healthy_gauge": 0,
"runs_failed_count": 0,
"runs_cs_failed_gauge": 0,
"runs_pending_items_gauge": 0
"runs_failed_count": 1,
"runs_cs_failed_gauge": 1,
"runs_pending_items_gauge": -1
}


Expand Down
2 changes: 1 addition & 1 deletion tests/load/pipeline/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def complex_data():
"cn": complex_part
}
], name="complex_cn")
info = dlt.run(complex_data(), destination=destination_name)
info = dlt.run(complex_data(), destination=destination_name, dataset_name="ds_" + uniq_id())
print(info)
assert_table(dlt.pipeline(), "complex_cn", [json.dumps(complex_part)])

Expand Down

0 comments on commit 39fde94

Please sign in to comment.