How to reproduce:
docker run --rm python:3.9 bash -c "pip install pandas && python -c 'import pandas; print(pandas.__version__)'"
Output:
% docker run --rm python:3.9 bash -c "pip install pandas && python -c 'import pandas; print(pandas.__version__)'"
... # pip install logs
2.3.0+4.g1dfc98e16a
Seems related to https://github.com/pandas-dev/pandas/issues/61563#issuecomment-2947099734
Comment From: harupy
@mroeschke Is this expected?
Comment From: shinny-taojiachun
I can confirm this. This breaks our pandas version check function in our sdk https://github.com/shinnytech/tqsdk-ci/actions/runs/15481907073/job/43589180749
Comment From: harupy
@shinny-taojiachun importlib.metadata.version
should work as a workaround.
Comment From: shinny-taojiachun
@harupy Thank you for your assistant. We are aware what we use in the past may not be the best practice. Newer release of our sdk should change to better version check. But releasing newer version takes a lot of time.
Meanwhile, this issue is blocking our users from using our sdk, especially new installation and upgrading of our sdk.
Comment From: datapythonista
I can confirm this happens to me, only for 3.9 and pandas installed via pip (installed via conda-forge has the right version)
Comment From: alexkuzmik
Same problem.
Comment From: yaricom
Broken ydata-profiling
integration due to this error.
../../../venv3.9/lib/python3.9/site-packages/ydata_profiling/__init__.py:10: in <module>
from ydata_profiling.compare_reports import compare # isort:skip # noqa
../../../venv3.9/lib/python3.9/site-packages/ydata_profiling/compare_reports.py:12: in <module>
from ydata_profiling.profile_report import ProfileReport
../../../venv3.9/lib/python3.9/site-packages/ydata_profiling/profile_report.py:26: in <module>
from visions import VisionsTypeset
../../../venv3.9/lib/python3.9/site-packages/visions/__init__.py:4: in <module>
from visions.backends import *
../../../venv3.9/lib/python3.9/site-packages/visions/backends/__init__.py:9: in <module>
import visions.backends.pandas
../../../venv3.9/lib/python3.9/site-packages/visions/backends/pandas/__init__.py:2: in <module>
import visions.backends.pandas.types
../../../venv3.9/lib/python3.9/site-packages/visions/backends/pandas/types/__init__.py:1: in <module>
import visions.backends.pandas.types.boolean
../../../venv3.9/lib/python3.9/site-packages/visions/backends/pandas/types/boolean.py:11: in <module>
from visions.backends.pandas.test_utils import (
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
../../../venv3.9/lib/python3.9/site-packages/_pytest/assertion/rewrite.py:184: in exec_module
exec(co, module.__dict__)
../../../venv3.9/lib/python3.9/site-packages/visions/backends/pandas/test_utils.py:12: in <module>
pandas_version = tuple(int(i) for i in pd.__version__.split("."))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.0 = <list_iterator object at 0x10eb67400>
> pandas_version = tuple(int(i) for i in pd.__version__.split("."))
E ValueError: invalid literal for int() with base 10: '0+4'
../../../venv3.9/lib/python3.9/site-packages/visions/backends/pandas/test_utils.py:12: ValueError
Comment From: mroeschke
Apologies, yes this is unexpected. This was due to having to release 3.9 wheels in an unorthodox way https://github.com/pandas-dev/pandas/pull/61569 with context in https://github.com/pandas-dev/pandas/issues/61563#issuecomment-2945331441
(Removing the good first issue
since the fix just involves releasing pandas though our normal mechanisms)