[BUG] Grouping by a nonexistent key gives `ValueError` rather than `KeyError`
Open
bug
Python
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
I would expect the code below to raise a `KeyError`, but it raises a `ValueError` instead:
```python
>>> import cudf
>>> df = cudf.DataFrame({'a': [1, 1, 2], 'b': [1, 2, 3]})
>>> df.groupby('cd').sum()
...
ValueError: Grouper and object must have same length
```
Contributor guide
Assessment
This issue has not been assessed yet.