()
| 274 | |
| 275 | @requires_dask |
| 276 | def test_char_to_bytes_dask() -> None: |
| 277 | numpy_array = np.array([[b"a", b"b", b"c"], [b"d", b"e", b"f"]]) |
| 278 | array = da.from_array(numpy_array, ((2,), (3,))) |
| 279 | expected = np.array([b"abc", b"def"]) |
| 280 | actual = strings.char_to_bytes(array) |
| 281 | assert isinstance(actual, da.Array) |
| 282 | assert actual.chunks == ((2,),) |
| 283 | assert actual.dtype == "S3" |
| 284 | assert_array_equal(np.array(actual), expected) |
| 285 | |
| 286 | with pytest.raises(ValueError, match=r"stacked dask character array"): |
| 287 | strings.char_to_bytes(array.rechunk(1)) |
| 288 | |
| 289 | |
| 290 | def test_bytes_to_char() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…