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

[FEA] AST expression was provided non-matching operand types #12319

Open
mattf opened this issue Dec 6, 2022 · 2 comments
Open

[FEA] AST expression was provided non-matching operand types #12319

mattf opened this issue Dec 6, 2022 · 2 comments
Labels
0 - Backlog In queue waiting for assignment bug Something isn't working Python Affects Python cuDF API.

Comments

@mattf
Copy link

mattf commented Dec 6, 2022

Is your feature request related to a problem? Please describe.
rewriting pandas code with import cudf as pd

Describe the solution you'd like

>>> import pandas as pd
>>> import cudf
>>> cudf.__version__
'22.10.01+2.gca9a422da9' <- rapidsai/rapidsai-nightly:cuda11.5-runtime-centos7-py3.9 (3b7d5d24867a) on 6 dec 2022
>>> df = cudf.DataFrame({'a': [1,2,3], 'b': [3.0,2.0,1.0]})
>>> df.to_pandas().eval('a + b')
0    4.0
1    4.0
2    4.0
dtype: float64
>>> df.eval('a + b')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/envs/rapids/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/opt/conda/envs/rapids/lib/python3.9/site-packages/cudf/core/dataframe.py", line 6766, in eval
    None: libcudf.transform.compute_column(
  File "transform.pyx", line 190, in cudf._lib.transform.compute_column
RuntimeError: cuDF failure at: /workspace/.conda-bld/work/cpp/src/ast/expression_parser.cpp:149: An AST expression was provided non-matching operand types.

same behavior as pandas

@mattf mattf added Needs Triage Need team to review and classify bug Something isn't working labels Dec 6, 2022
@vyasr
Copy link
Contributor

vyasr commented Dec 6, 2022

This is a known and documented behavior, we do not currently support automatic casting of types. I just realized that the documentation for eval was not being published, I've opened a PR to fix that.

@mattf mattf changed the title [BUG] AST expression was provided non-matching operand types [FEA] AST expression was provided non-matching operand types Dec 7, 2022
@mattf
Copy link
Author

mattf commented Dec 7, 2022

update to FEA from BUG

@GregoryKimball GregoryKimball added 0 - Backlog In queue waiting for assignment Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels Jun 6, 2023
@vyasr vyasr added this to cuDF Python Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - Backlog In queue waiting for assignment bug Something isn't working Python Affects Python cuDF API.
Projects
Status: Todo
Development

No branches or pull requests

3 participants