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

test_from_dict_backends failure on gpuCI #9676

Closed
jrbourbeau opened this issue Nov 18, 2022 · 8 comments
Closed

test_from_dict_backends failure on gpuCI #9676

jrbourbeau opened this issue Nov 18, 2022 · 8 comments
Labels
gpu tests Unit tests and/or continuous integration

Comments

@jrbourbeau
Copy link
Member

See #9675 (review)

10:10:22 ________________________ test_from_dict_backends[cudf] _________________________
10:10:22 [gw2] linux -- Python 3.9.13 /opt/conda/envs/dask/bin/python3.9
10:10:22 
10:10:22 backend = 'cudf'
10:10:22 
10:10:22     @pytest.mark.gpu
10:10:22     @pytest.mark.parametrize("backend", ["pandas", "cudf"])
10:10:22     def test_from_dict_backends(backend):
10:10:22         _lib = pytest.importorskip(backend)
10:10:22         with config.set({"dataframe.backend": backend}):
10:10:22             data = {"a": [1, 2, 3, 4], "B": [10, 11, 12, 13]}
10:10:22             expected = _lib.DataFrame(data)
10:10:22     
10:10:22             # Check dd.from_dict API
10:10:22             got = dd.from_dict(data, npartitions=2)
10:10:22             assert_eq(expected, got)
10:10:22     
10:10:22             # Check from_dict classmethod
10:10:22 >           got_classmethod = got.from_dict(data, npartitions=2)
10:10:22 
10:10:22 dask/dataframe/io/tests/test_io.py:988: 
10:10:22 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10:10:22 dask/dataframe/core.py:6054: in from_dict
10:10:22     return from_dict(
10:10:22 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
10:10:22 
10:10:22 args = ({'B': [10, 11, 12, 13], 'a': [1, 2, 3, 4]}, 2)
10:10:22 kwargs = {'columns': None, 'constructor': <class 'cudf.core.dataframe.DataFrame'>, 'dtype': None, 'orient': 'columns'}
10:10:22 
10:10:22     @wraps(fn)
10:10:22     def wrapper(*args, **kwargs):
10:10:22 >       return getattr(self, dispatch_name)(*args, **kwargs)
10:10:22 E       TypeError: from_dict() got an unexpected keyword argument 'constructor'
10:10:22 
10:10:22 dask/backends.py:122: TypeError

cc @rjzamora @galipremsagar @charlesbluca

@jrbourbeau jrbourbeau added tests Unit tests and/or continuous integration gpu labels Nov 18, 2022
@jrbourbeau
Copy link
Member Author

From skimming the above traceback and some relevant parts of cudf, my guess is this error is because CudfBackendEntrypoint.from_dict doesn't have a constructor= keyword (though it's a bit convoluted figuring out what's being called where from the backend dispatching)

@galipremsagar
Copy link
Contributor

I'm looking into it.

@rjzamora
Copy link
Member

Thanks for raising this issue @jrbourbeau .

@galipremsagar - It looks like we are missing the constructor kwarg here (my fault for missing this earlier).

@rjzamora
Copy link
Member

rjzamora commented Nov 18, 2022

From skimming the above traceback and some relevant parts of cudf, my guess is this error is because CudfBackendEntrypoint.from_dict doesn't have a constructor= keyword (though it's a bit convoluted figuring out what's being called where from the backend dispatching)

Agree @jrbourbeau . I think we should add a try/except in the register_inplace wrapper to make it more obvious when there is an error in the entrypoint method.

@galipremsagar
Copy link
Contributor

register_inplace

@rjzamora Would want to open a PR with dask? I'll be opening a PR in dask-cudf

@jrbourbeau
Copy link
Member Author

I think we should add a try/except in the register_inplace wrapper to make it more obvious when there is an error in the entrypoint method.

+1 for more informative error messages

I'll be opening a PR in dask-cudf

Sweet, thanks @galipremsagar

FWIW I'm not viewing this as a blocker for the dask / distributed release today as the patch is needed in dask-cudf

@rjzamora
Copy link
Member

FWIW I'm not viewing this as a blocker for the dask / distributed release today as the patch is needed in dask-cudf

Yeah, totally agree that this is not a dask blocker. Thanks for confirming!

ajschmidt8 pushed a commit to rapidsai/cudf that referenced this issue Nov 18, 2022
This PR fixes a failure being observed in `dask` upstream: dask/dask#9676

Authors:
   - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
   - Richard (Rick) Zamora (https://github.com/rjzamora)
@rjzamora
Copy link
Member

This issue should now be resolved in cudf. Thanks @galipremsagar for fixing and @jrbourbeau for surfacing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gpu tests Unit tests and/or continuous integration
Projects
None yet
Development

No branches or pull requests

3 participants