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
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.