Skip to content
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

[REVIEW] Add support for make_meta_obj dispatch in dask-cudf #8342

Merged
merged 4 commits into from
May 26, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add tests
  • Loading branch information
galipremsagar committed May 25, 2021
commit 6c0caa0d3cf8ed508681f98ffcb99c61b64a7a24
17 changes: 17 additions & 0 deletions python/dask_cudf/dask_cudf/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,3 +778,20 @@ def test_index_map_partitions():
mins_gd = gddf.index.map_partitions(M.min, meta=gddf.index).compute()

dd.assert_eq(mins_pd, mins_gd)


def test_correct_meta():
# Need these local imports in this specific order.
# For context: https://github.com/rapidsai/cudf/issues/7946
import pandas as pd

from dask import dataframe as dd

import dask_cudf # noqa: F401

df = pd.DataFrame({"a": [3, 4], "b": [1, 2]})
ddf = dd.from_pandas(df, npartitions=1)
emb = ddf["a"].apply(pd.Series, meta={"c0": "int64", "c1": "int64"})

assert isinstance(emb, dd.DataFrame)
assert isinstance(emb._meta, pd.DataFrame)