-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] Fix all-null ImageArray length issues (#2034)
Fixes bug where a fast-path for `ImageArray` with all nulls would cause a length-0 array to be created Co-authored-by: Jay Chia <[email protected]@users.noreply.github.com>
- Loading branch information
Showing
4 changed files
with
26 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from __future__ import annotations | ||
|
||
import daft | ||
|
||
|
||
def test_decode_all_empty(): | ||
df = daft.from_pydict({"foo": [b"not an image", None]}) | ||
df = df.with_column("image", df["foo"].image.decode(on_error="null")) | ||
df.collect() | ||
|
||
assert df.to_pydict() == { | ||
"foo": [b"not an image", None], | ||
"image": [None, None], | ||
} |