Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with resize in mode='a' #718

Merged
merged 2 commits into from
Mar 26, 2021
Merged
Changes from 1 commit
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
Prev Previous commit
Add test for resizing dataset in mode 'a'
  • Loading branch information
kristinagrig06 committed Mar 26, 2021
commit 18b45f815e4a7aaa5ffb6aaf6271bf9337183ca9
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