MCPcopy
hub / github.com/pandas-dev/pandas / test_dask_ufunc

Function test_dask_ufunc

pandas/tests/test_downstream.py:50–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48# TODO(CoW) see https://github.com/pandas-dev/pandas/pull/51082
49@pytest.mark.skip(reason="not implemented with CoW")
50def test_dask_ufunc():
51 # dask sets "compute.use_numexpr" to False, so catch the current value
52 # and ensure to reset it afterwards to avoid impacting other tests
53 olduse = pd.get_option("compute.use_numexpr")
54
55 try:
56 da = pytest.importorskip("dask.array")
57 dd = pytest.importorskip("dask.dataframe")
58
59 s = Series([1.5, 2.3, 3.7, 4.0])
60 ds = dd.from_pandas(s, npartitions=2)
61
62 result = da.log(ds).compute()
63 expected = np.log(s)
64 tm.assert_series_equal(result, expected)
65 finally:
66 pd.set_option("compute.use_numexpr", olduse)
67
68
69def test_construct_dask_float_array_int_dtype_match_ndarray():

Callers

nothing calls this directly

Calls 2

SeriesClass · 0.90
computeMethod · 0.45

Tested by

no test coverage detected