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

Generalize array checking and remove pd.Index call in _get_partitions #9634

Merged
merged 3 commits into from Nov 8, 2022

Conversation

quasiben
Copy link
Member

@quasiben quasiben commented Nov 7, 2022

This PR does two things:

  1. Generalizes the array checking using is_arraylike as well as the list check
  2. Removes what I think is an unnecessary pd.Index call .

This fixes an issue for dask-cudf where users want to index a Dask Dataframe with a cudf/cupy object:

df.loc[cudf.Series([0,10,50], dtype=np.int32)]

The pd.Index call is quite old (#1913) and was originally written to handle indexing with lists. Locally I ran dask/dataframe/tests/test_indexing.py and all tests still pass as well as verifying manually that lists are still supported

  • Closes #xxxx
  • Tests added / passed
  • Passes pre-commit run --all-files

cc @VibhuJawa @rjzamora

@VibhuJawa
Copy link
Contributor

VibhuJawa commented Nov 7, 2022

Thanks for working on this @quasiben , I expect to see some speed up for the GNN use cases when this lands.

CC: @eriknw for awareness too in relation to get_edge_data and get_node_data for PropertyGraphs.

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @quasiben! Can we add a test for this?

dask/dataframe/indexing.py Outdated Show resolved Hide resolved
@jrbourbeau jrbourbeau changed the title Generalize array checking and remove unnecssary pd.Index call Generalize array checking and remove pd.Index call in _get_partitions Nov 8, 2022
@quasiben
Copy link
Member Author

quasiben commented Nov 8, 2022

Thanks for the review @jrbourbeau -- added a test and found another spot where we needed another array-like call

Co-authored-by: James Bourbeau <jrbourbeau@users.noreply.github.com>
@jrbourbeau
Copy link
Member

My guess is the gpuCI failures are unrelated (saw them here yesterday #9635 (review)), though it'd be great if you could confirm

@quasiben quasiben mentioned this pull request Nov 8, 2022
@quasiben
Copy link
Member Author

quasiben commented Nov 8, 2022

@jrbourbeau , yes, they are unrelated. I filed #9639 to track the failures

Copy link
Member

@jrbourbeau jrbourbeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @quasiben

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants