-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[python-package] support pandas 2.0 #5739
Comments
As reported in #5823,
I can investigate this tonight or tomorrow. |
@fermiyon I haven't been able to reproduce the error you mentioned yet. I suspect it's coming from one of I can see that # check on latest master
git grep StringMethod
# check on latest release (v3.3.5)
git checkout v3.3.5
git grep StringMethod Could you please share some more details with us?
|
Alright, I was able to test @fermiyon, I believe the error you've reported is coming from short summary
If you encounter the following error when importing
... either remove pip uninstall --yes \
dask ... or upgrade it and pip install \
'dask>2023.3.2' \
'distributed>2023.3.2' Cause for that incompatibility:
How I tested thisinvestigation (click me)docker build -t test-lgb:local -<<EOF
FROM python:3.10
RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
graphviz \
&& pip install --upgrade pip \
&& pip install \
cloudpickle \
graphviz \
matplotlib \
numpy \
'pandas>=2.0' \
psutil \
pytest \
scikit-learn \
scipy
EOF v3.3.5 of the Python package (no Dask)# test v3.3.5 of the Python package
git checkout v3.3.5
docker run \
--rm \
-v $(pwd):/opt/LightGBM \
-w /opt/LightGBM \
-it test-lgb:local \
bash -c "
pip install 'lightgbm==3.3.5' && \
pytest tests/python_package_test
"
v3.3.5 of the Python package (with latest Dask)git checkout v3.3.5
docker run \
--rm \
-v $(pwd):/opt/LightGBM \
-w /opt/LightGBM \
-it test-lgb:local \
bash -c "
pip install 'dask==2023.3.2' 'distributed==2023.3.2.1' 'lightgbm==3.3.5' && \
pytest tests/python_package_test
"
v3.3.5 of the Python package (with Dask 2022.12.1)git checkout v3.3.5
docker run \
--rm \
-v $(pwd):/opt/LightGBM \
-w /opt/LightGBM \
-it test-lgb:local \
bash -c "
pip install 'dask==2023.1.1' 'distributed==2023.1.1' 'lightgbm==3.3.5' && \
pytest tests/python_package_test
"
latest
|
short summaryUpgrading the Dask to version 2023.3.2 solved the issue. SolutionUpgrading Dask to version 2023.3.2 resolved the issue as @jameslamb pointed out, I ran the following command in my terminal to upgrade Dask:
After upgrading, I re-ran my code and the error was resolved. I was using conda 23.3.1 environment, python 3.10.9, lightgbm 3.3.5, pandas 2.0.0 upgraded. |
thanks for confirming @fermiyon ! Alright then based on the evidence I provided above, I think Anyone finding this issue from search who thinks they've found evidence of an incompatibility, please comment here with a reproducible example. |
short summaryIt seems to me that LightGBM 3.3.5 doesn't support pandas 2.0 pyarrow data types Code
Error
EnvironmentPython version:3.10 |
Same issue continues in LightGBM 4.0.0 Python 3.9.12 | Pandas 2.0.3 | Numpy 1.22.4 | LightGBM 4.0.0 == ValueError: pandas dtypes must be int, float or bool. |
Summary
This week,
pandas
developers announced a release candidate for the next major release, v2.0.https://twitter.com/pandas_dev/status/1628159973988483074?s=20
I'm going to test
lightgbm
's latest release (v3.3.5) and latest source (f975d3f).Opening this issue to publicize the fact that I'm doing that work, and to link to from any PRs generated as a result of that testing.
The text was updated successfully, but these errors were encountered: