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

xgboost v2.1.0 is incompatible with pandas<1.2 #10471

Closed
winwinashwin opened this issue Jun 21, 2024 · 3 comments · Fixed by #10476
Closed

xgboost v2.1.0 is incompatible with pandas<1.2 #10471

winwinashwin opened this issue Jun 21, 2024 · 3 comments · Fixed by #10476

Comments

@winwinashwin
Copy link

winwinashwin commented Jun 21, 2024

To Reproduce

import xgboost as xgb
import pandas as pd

X = xgb.DMatrix(pd.DataFrame({"a": [1, 2], "b": [2, 4]}), label=[0, 1])

xgboost==2.1.0, pandas==1.1.5 ---> FAIL
xgboost==2.0.3, pandas==1.1.5 ---> PASS
xgboost==2.1.0, pandas==1.2.0 ---> PASS


There is no version constraint specified in pyproject.toml for pandas optional dependency.

The Float32Dtype used here is only available in pandas v1.2+

from pandas import Float32Dtype, Float64Dtype

@trivialfis
Copy link
Member

At the moment, we are not very good at keeping track of these input versions and the policy is always testing with the latest for optional dependencies (pandas is not required to run xgboost). Otherwise, the constraint solver will run into trouble with the amount of input types https://github.com/dmlc/xgboost/blob/master/doc/python/python_intro.rst#support-matrix .

@trivialfis
Copy link
Member

Hopefully, #10452 can help in the future.

@hcho3
Copy link
Collaborator

hcho3 commented Jun 21, 2024

For now, let's require Pandas 1.2+. I submitted #10476

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

Successfully merging a pull request may close this issue.

3 participants