Skip to content

BUG:float_precision type hints differ in release version from github and docs pandas==2.3.1 #61873

Open
@mas-4

Description

@mas-4

Pandas version checks

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

  • 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

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

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.

37d7db4

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 : c888af6
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions