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
11 changes: 11 additions & 0 deletions hub/api/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,16 @@ def test_append_dataset():
assert ds["second"].shape[0] == 120


def test_append_resize():
dt = {"first": Tensor(shape=(250, 300)), "second": "float"}
url = "./data/test/append_resize"
ds = Dataset(schema=dt, shape=(100,), url=url, mode="a")
ds.append_shape(20)
assert len(ds) == 120
ds.resize_shape(150)
assert len(ds) == 150


def test_meta_information():
description = {"author": "testing", "description": "here goes the testing text"}

Expand Down Expand Up @@ -1185,6 +1195,7 @@ def test_minio_endpoint():
test_dataset()
test_dataset_batch_write_2()
test_append_dataset()
test_append_resize()
test_dataset_2()
test_text_dataset()
test_text_dataset_tokenizer()
Expand Down
2 changes: 1 addition & 1 deletion hub/store/dynamic_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(

if ("r" in mode or "a" in mode) and exist:
meta = json.loads(fs_map.get(".hub.dynamic_tensor").decode("utf-8"))
shape = meta["shape"]
shape = tuple(meta["shape"])
self._dynamic_dims = get_dynamic_dims(shape)
self._storage_tensor = zarr.open_array(
store=fs_map, mode=mode, synchronizer=synchronizer
Expand Down