Skip to content

Commit

Permalink
Fix tests for dask dataframe and delayed backends
Browse files Browse the repository at this point in the history
  • Loading branch information
stephan-hesselmann-by committed Apr 12, 2021
1 parent 8a3e6ae commit 5520f74
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kartothek/io/dask/delayed.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def update_dataset_from_delayed(
sort_partitions_by=None,
secondary_indices=None,
factory=None,
table_name=SINGLE_TABLE,
):
"""
A dask.delayed graph to add and store a list of dictionaries containing
Expand Down Expand Up @@ -304,6 +305,7 @@ def update_dataset_from_delayed(
df_serializer=df_serializer,
dataset_uuid=dataset_uuid,
sort_partitions_by=sort_partitions_by,
dataset_table_name=table_name,
)

return dask.delayed(update_dataset_from_partitions)(
Expand Down
2 changes: 1 addition & 1 deletion kartothek/io/testing/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def test_update_of_dataset_with_non_default_table_name(
[df_update],
store=store_factory,
dataset_uuid=dataset_uuid,
table="non-default-name",
table_name="non-default-name",
partition_on=["date"],
)
dm = DatasetMetadata.load_from_store(dataset_uuid, store_factory())
Expand Down
6 changes: 6 additions & 0 deletions tests/io/dask/dataframe/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ def _update_dataset(partitions, *args, **kwargs):
else:
partitions = None

# Replace `table_name` with `table` keyword argument to enable shared test code
# via `bound_update_dataset` fixture
if "table_name" in kwargs:
kwargs["table"] = kwargs["table_name"]
del kwargs["table_name"]

ddf = update_dataset_from_ddf(partitions, *args, **kwargs)

s = pickle.dumps(ddf, pickle.HIGHEST_PROTOCOL)
Expand Down

0 comments on commit 5520f74

Please sign in to comment.