NVIDIA / NVIDIA/cudf

[FEA] `DataFrame.query` should be updated to use `eval` as a backend

Open
#12,318 1 comment 0 reactions 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

cuDF supports a [query](https://docs.rapids.ai/api/cudf/nightly/api_docs/api/cudf.DataFrame.query.html) function for evaluating expressions against dataframes. Thus far it has worked by using the `ast` _python_ package to build a python function that gets wrapped in a numba kernel and launched not unlike a UDF. Pandas seems to work by leveraging its own [eval function however](https://github.com/pandas-dev/pandas/blob/v1.5.2/pandas/core/frame.py#L4377-L4378), which I don't think we had at the time `query` was developed. We should investigate if we can make `cudf.DataFrame.query` work similarly. This would have a bunch of benefits including most likely faster performance, no need for runtime compilation or caching, I'm guessing code reduction, and anything new that we get in our internal ast framework that backs `eval`.

cc @vyasr

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.