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

BUG: Pass Groupby kwargs to panads grouper #7412

Open
2 tasks done
Servinjesus1 opened this issue Dec 11, 2024 · 0 comments
Open
2 tasks done

BUG: Pass Groupby kwargs to panads grouper #7412

Servinjesus1 opened this issue Dec 11, 2024 · 0 comments
Labels
bug 🦗 Something isn't working Triage 🩹 Issues that need triage

Comments

@Servinjesus1
Copy link

Servinjesus1 commented Dec 11, 2024

Modin version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest released version of Modin.

Reproducible Example

import modin.pandas as pd
import numpy as np
import warnings

warnings.filterwarnings("error", category=FutureWarning)

dff = pd.DataFrame()
dff['col'] = pd.Series(np.random.randint(0,5,1000)).astype('category')
dff[dff.col > 1].groupby('col', observed=True)

Issue Description

Groupby keword arguments should be passed to the pandas grouper when e.g. calculating group indices.
This is a small change to help alleviate a potentially breaking change in the future when pandas changes defaults.
In this case, observed will default to true in the future. So far I haven't run into an issue dealing with observed=False inside modin, but of course that might change.

The above will error showing the trace to one example in modin where this happens: DataFrameGroupBy._compute_index_grouped (ln 1568 in pandas/groupby.py.

As an example.

Expected Behavior

Modin groupby should play well with pandas groupby when specific groupby parameters are desired

Error Logs

No response

Installed Versions

INSTALLED VERSIONS

commit : 3e951a6
python : 3.10.12
python-bits : 64
OS : Linux
OS-release : 5.4.0-190-generic
Version : #210-Ubuntu SMP Fri Jul 5 17:03:38 UTC 2024
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8

Modin dependencies

modin : 0.32.0
ray : 2.36.1
dask : 2024.8.2
distributed : 2024.8.2

pandas dependencies

pandas : 2.2.3
numpy : 1.26.4
pytz : 2024.1
dateutil : 2.9.0.post0
pip : 24.2
Cython : None
sphinx : None
IPython : 8.27.0
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
blosc : None
bottleneck : 1.4.2
dataframe-api-compat : None
fastparquet : 2024.2.0
fsspec : 2024.6.1
html5lib : None
hypothesis : None
gcsfs : None
jinja2 : 3.1.4
lxml.etree : 4.9.2
matplotlib : 3.9.2
numba : 0.60.0
numexpr : 2.10.1
odfpy : None
openpyxl : None
pandas_gbq : None
psycopg2 : None
pymysql : None
pyarrow : 16.1.0
pyreadstat : None
pytest : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : 1.14.1
sqlalchemy : None
tables : 3.10.1
tabulate : None
xarray : None
xlrd : None
xlsxwriter : None
zstandard : None
tzdata : 2023.3
qtpy : 2.4.1
pyqt5 : None

@Servinjesus1 Servinjesus1 added bug 🦗 Something isn't working Triage 🩹 Issues that need triage labels Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🦗 Something isn't working Triage 🩹 Issues that need triage
Projects
None yet
Development

No branches or pull requests

1 participant