Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VioletM committed Aug 26, 2024
1 parent 227c89c commit 23b6f4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions dlt/destinations/impl/bigquery/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ def __init__(
config.http_timeout,
config.retry_deadline,
)
SupportsStagingDestination.__init__(
self, config.truncate_table_before_load_on_staging_destination
)
SupportsStagingDestination.__init__(self, config)
super().__init__(schema, config, sql_client)
self.config: BigQueryClientConfiguration = config
self.sql_client: BigQuerySqlClient = sql_client # type: ignore
Expand Down
6 changes: 4 additions & 2 deletions dlt/destinations/impl/dummy/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dlt.common.configuration import configspec
from dlt.common.destination import TLoaderFileFormat
from dlt.common.destination.reference import (
DestinationClientConfiguration,
DestinationClientDwhWithStagingConfiguration,
CredentialsConfiguration,
)

Expand All @@ -16,7 +16,7 @@ def __str__(self) -> str:


@configspec
class DummyClientConfiguration(DestinationClientConfiguration):
class DummyClientConfiguration(DestinationClientDwhWithStagingConfiguration):
destination_type: Final[str] = dataclasses.field(default="dummy", init=False, repr=False, compare=False) # type: ignore
loader_file_format: TLoaderFileFormat = "jsonl"
fail_schema_update: bool = False
Expand All @@ -36,6 +36,8 @@ class DummyClientConfiguration(DestinationClientConfiguration):
"""raise transient exception in job init"""
truncate_table_before_load_on_staging_destination: bool = True
"""truncate tables on staging destination"""
dataset_name: str = "dummy"
"""dummy dataset name"""

# new jobs workflows
create_followup_jobs: bool = False
Expand Down
2 changes: 1 addition & 1 deletion tests/load/test_dummy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def test_truncate_table_before_load_on_stanging(to_truncate) -> None:
load_id, schema = prepare_load_package(load.load_storage, NORMALIZED_FILES)
destination_client = load.get_destination_client(schema)
assert (
destination_client.should_truncate_table_before_load_on_staging_destination(
destination_client.should_truncate_table_before_load_on_staging_destination( # type: ignore
schema.tables["_dlt_version"]
)
== to_truncate
Expand Down

0 comments on commit 23b6f4e

Please sign in to comment.