Skip to content

Commit

Permalink
fix linter again and remove wrong value from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Jul 30, 2024
1 parent 5c07c07 commit d1b2144
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dlt/common/destination/reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ def create_load_job(
"""Creates a load job for a particular `table` with content in `file_path`"""
pass

def prepare_load_job_execution(
def prepare_load_job_execution( # noqa: B027, optional override
self, job: RunnableLoadJob
) -> None: # noqa: B027, optional override
) -> None:
"""Prepare the connected job client for the execution of a load job (used for query tags in sql clients)"""
pass

Expand Down
2 changes: 1 addition & 1 deletion tests/cli/test_pipeline_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def test_pipeline_command_drop_partial_loads(repo_dir: str, project_files: FileS
venv = Venv.restore_current()
with pytest.raises(CalledProcessError) as cpe:
print(venv.run_script("chess_pipeline.py"))
assert "Dummy job status raised exception" in cpe.value.stdout

# move job into running folder manually
pipeline = dlt.attach(pipeline_name="chess_pipeline")
Expand All @@ -219,7 +220,6 @@ def test_pipeline_command_drop_partial_loads(repo_dir: str, project_files: FileS
load_storage.normalized_packages.start_job(
load_id, FileStorage.get_file_name_from_file_path(job)
)
assert "Dummy job status raised exception" in cpe.value.stdout

with io.StringIO() as buf, contextlib.redirect_stdout(buf):
pipeline_command.pipeline_command("info", "chess_pipeline", None, 1)
Expand Down
8 changes: 5 additions & 3 deletions tests/load/test_dummy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_big_loadpackages() -> None:
load = setup_loader()
# make the loop faster by basically not sleeping
load._run_loop_sleep_duration = 0.001
load_id, schema = prepare_load_package(load.load_storage, SMALL_FILES, jobs_per_case=5000)
load_id, schema = prepare_load_package(load.load_storage, SMALL_FILES, jobs_per_case=500)
start_time = time()
with ThreadPoolExecutor(max_workers=20) as pool:
load.run(pool)
Expand Down Expand Up @@ -461,8 +461,10 @@ def test_failing_sql_table_chain_job() -> None:
assert_complete_job(load)

# sql jobs always fail because this is not an sql client, we just make sure the exception is there
assert "x-normalizer:" in str(exc)
assert "'DummyClient' object has no attribute" in str(exc)
assert (
"Failed creating table chain followup jobs for table chain with root table event_user"
in str(exc)
)


def test_successful_table_chain_jobs() -> None:
Expand Down

0 comments on commit d1b2144

Please sign in to comment.