Skip to content

Commit

Permalink
Add back test_struct_scalar_null
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Jan 17, 2025
1 parent d146229 commit 8472cf8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/cudf/cudf/core/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def value(self):
self._device_value_to_host()
return self._host_value

# TODO: change to @functools.cached_property
@property
def dtype(self):
if self._host_dtype is not None:
Expand Down
5 changes: 5 additions & 0 deletions python/cudf/cudf/tests/test_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ def test_struct_scalar_host_construction_no_dtype_inference(data, dtype):
assert slr.value == data


def test_struct_scalar_null():
slr = cudf.Scalar(cudf.NA, dtype=cudf.StructDtype)
assert cudf.Scalar.from_pylibcudf(slr.device_value).value is cudf.NA


def test_struct_explode():
s = cudf.Series([], dtype=cudf.StructDtype({}))
expect = cudf.DataFrame({})
Expand Down

0 comments on commit 8472cf8

Please sign in to comment.