-
Notifications
You must be signed in to change notification settings - Fork 615
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
Empty extend fix #1335
Empty extend fix #1335
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1335 +/- ##
==========================================
- Coverage 91.80% 90.85% -0.95%
==========================================
Files 151 146 -5
Lines 10820 10484 -336
==========================================
- Hits 9933 9525 -408
- Misses 887 959 +72
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but for minor test change.
@@ -794,3 +794,13 @@ def test_tobytes(memory_ds, compressed_image_paths, audio_paths): | |||
for i in range(3): | |||
assert ds.image[i].tobytes() == image_bytes | |||
assert ds.audio[i].tobytes() == audio_bytes | |||
|
|||
|
|||
def test_empty_extend(memory_ds): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a doc line like "test extend empty tensor" or rename the test to something like test_extend_empty_tensor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are not testing extending an empty tensor, but rather extending a tensor with an empty list/array.
ds.x.append(1) | ||
ds.create_tensor("y") | ||
ds.y.extend(np.zeros((len(ds), 3))) | ||
assert len(ds) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the expected len(ds.y)
here? Please add assertion.
Moved to #1365 |
🚀 🚀 Pull Request
Checklist:
coverage-rate
upChanges
Fixes dataset corruption when extending with empty list / array
https://activeloop.atlassian.net/browse/AL-1418