Skip to content
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

Confusing warning when calling read_csv() with fsspec URL #19150

Closed
2 tasks done
BartSchuurmans opened this issue Oct 8, 2024 · 5 comments
Closed
2 tasks done

Confusing warning when calling read_csv() with fsspec URL #19150

BartSchuurmans opened this issue Oct 8, 2024 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers python Related to Python Polars

Comments

@BartSchuurmans
Copy link
Contributor

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl

pl.read_csv("local:///tmp/good.csv")

Log output

/home/minnozz/src/example.py:3: UserWarning: Polars found a filename. Ensure you pass a path to the file instead of a python file object when possible for best performance.
  pl.read_csv("local:///tmp/good.csv")
file < 128 rows, no statistics determined
no. of chunks: 1 processed by: 1 threads.

Issue description

The text of the warning is confusing. What Polars received (a filename) and what would be optimal (a path to the file) sound identical to me; one of those is probably wrong.

Expected behavior

Aside from the text of the warning, I also did not expect to receive this warning when using fsspec URLs. I believe in an earlier version you got this warning when you passed an open file to a read function, but passing an open file no longer triggers this warning.

Installed versions

--------Version info---------
Polars:              1.9.0
Index type:          UInt32
Platform:            Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python:              3.12.7 (main, Oct  1 2024, 08:52:12) [GCC 11.4.0]

----Optional dependencies----
adbc_driver_manager  <not installed>
altair               <not installed>
cloudpickle          <not installed>
connectorx           <not installed>
deltalake            <not installed>
fastexcel            <not installed>
fsspec               2024.9.0
gevent               <not installed>
great_tables         <not installed>
matplotlib           <not installed>
nest_asyncio         1.6.0
numpy                2.1.2
openpyxl             <not installed>
pandas               <not installed>
pyarrow              17.0.0
pydantic             <not installed>
pyiceberg            <not installed>
sqlalchemy           <not installed>
torch                <not installed>
xlsx2csv             <not installed>
xlsxwriter           <not installed>
@BartSchuurmans BartSchuurmans added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Oct 8, 2024
@coastalwhite coastalwhite added good first issue Good for newcomers and removed needs triage Awaiting prioritization by a maintainer labels Oct 8, 2024
@benrutter
Copy link
Contributor

benrutter commented Oct 23, 2024

Anyone know the status of this? I haven't contributed to polars before but would love to pick it up, but looks like @ComputingVictor had a PR in place but closed it before it could merge?

@BartSchuurmans
Copy link
Contributor Author

I haven't tried to reproduce this since, but #19154 may have fixed this

@ComputingVictor
Copy link

Anyone know the status of this? I haven't contributed to polars before but would love to pick it up, but looks like @ComputingVictor had a PR in place but closed it before it could merge?

Feel free to contribute. I closed due to incompatibilities with the new version of Polars!

@astrojuanlu
Copy link

Indeed, gh-19154 fixed this, the warning no longer appears in Polars 1.10 ✔️

(Gracias @ComputingVictor for giving it a try!)

@BartSchuurmans
Copy link
Contributor Author

Thanks for checking @astrojuanlu, I'll close this then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers python Related to Python Polars
Projects
None yet
Development

No branches or pull requests

5 participants