Pandas version checks

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

  • [x] I have confirmed this bug exists on the latest version of pandas.

  • [ ] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

python -m venv venv
source ./venv/scripts/activate
python -m pip install pandas==2.3.1


Open a modern ide like pycharm and type


pd.read_csv(path, float_precision='round_trip')

and you will see type check erroring because the code is different.

Issue Description

This is probably a bug in distribution.

I currently have installed on my windows system pandas 2.3.1. When I open

.venv/Lib/site-packages/pandas/io/parsers/readers.py

I see the following line in 3 different definitions for read_csv:

    float_precision: Literal["high", "legacy"] | None = None,

However, the documentation specifies a third option, 'round_trip', and so does the code here on github

https://github.com/pandas-dev/pandas/blob/1d153bb1a4c6549958a20e04508967e2ed45159f/pandas/io/parsers/readers.py#L141

I don't understand how this line is different in a pip installed latest version, but not on github.com. This code was fixed back at the beginning of 2024, 18+ months ago.

https://github.com/pandas-dev/pandas/commit/37d7db4a1a1f6928a1541eaab05f51318d1d3344

Why does it not appear in pip installable distributions?

Expected Behavior

I expect the line

float_precision: Literal["high", "legacy"] | None = None,

in pandas/io/parsers/readers.py to read

float_precision: Literal["high", "legacy", "round_trip"] | None = ...,

Installed Versions

INSTALLED VERSIONS ------------------ commit : c888af6d0bb674932007623c0867e1fbd4bdc2c6 python : 3.13.2 python-bits : 64 OS : Windows OS-release : 11 Version : 10.0.26100 machine : AMD64 processor : Intel64 Family 6 Model 170 Stepping 4, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : English_United States.1252 pandas : 2.3.1 numpy : 2.2.1 pytz : 2024.2 dateutil : 2.9.0.post0 pip : 25.1.1 Cython : None sphinx : None IPython : 9.2.0 adbc-driver-postgresql: None adbc-driver-sqlite : None bs4 : 4.12.3 blosc : None bottleneck : None dataframe-api-compat : None fastparquet : None fsspec : None html5lib : None hypothesis : None gcsfs : None jinja2 : 3.1.5 lxml.etree : 5.3.0 matplotlib : 3.10.0 numba : None numexpr : None odfpy : None openpyxl : None pandas_gbq : None psycopg2 : 2.9.10 pymysql : None pyarrow : None pyreadstat : None pytest : 8.3.4 python-calamine : None pyxlsb : None s3fs : None scipy : 1.14.1 sqlalchemy : 2.0.36 tables : None tabulate : None xarray : None xlrd : None xlsxwriter : None zstandard : None tzdata : 2024.2 qtpy : None pyqt5 : None

Comment From: rhshadrach

The referenced commit will not be released until pandas 3.0.

https://github.com/pandas-dev/pandas/pull/56915

I believe this will resolve the issue.