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

Unavoidable warning if fsspec is not installed #500

Closed
chrullrich opened this issue Jul 7, 2020 · 4 comments
Closed

Unavoidable warning if fsspec is not installed #500

chrullrich opened this issue Jul 7, 2020 · 4 comments

Comments

@chrullrich
Copy link

chrullrich commented Jul 7, 2020

Minimal, reproducible code sample, a copy-pastable example if possible

python -c "import petl"
# Missing fsspec package. Install with: pip install fsspec

Problem description

It is not possible to use petl without this warning, even if no remote I/O is used or intended.

Version and installation information

  • Value of petl.__version__: "1.6.0"
  • Version of Python interpreter: 3.8.3
  • Operating system (Linux/Windows/Mac): Windows
  • How petl was installed: pip in venv
@juarezr
Copy link
Member

juarezr commented Jul 7, 2020

@chrullrich ,

  • You should use pet without fsspec without problems.
  • This message can be safely ignored if you are not using remote I/O.
  • Also using URIs like http://, ftp:// and smb:// as parameters for to...() and from..() functions should work without fsspec.

Please let me know:

  • There is any breakage in your code?
  • How exactly this message impacts?

@chrullrich
Copy link
Author

The message causes no breakage, although an easy situation to imagine is where petl is used in a subprocess, and the warning shows up in stderr unexpectedly, or even causes the parent to consider the subprocess failed because it produced any output on stderr at all.

The impact is that the absence of an optional dependency causes a warning; I don't think this is how it should be.

A better way to solve this (other than adding it as a required dependency) is to use extras_require and let others depend on petl[remote] if they plan to use it. If fsspec is then only imported once it is actually needed, anyone who tries to use remote I/O without declaring that intention gets an ImportError, which is no more than they deserve.

@juarezr
Copy link
Member

juarezr commented Jul 7, 2020

@chrullrich,

Looks like a good approach to me.
I'll try to silence the warning soon.

juarezr pushed a commit to juarezr/petl that referenced this issue Jul 8, 2020
juarezr pushed a commit that referenced this issue Jul 10, 2020
@juarezr
Copy link
Member

juarezr commented Jul 10, 2020

Merged a fix in a6d791d of #501

Scheduled for release v1.6.1:

In the case there are remaining issues left please tell us again.

@juarezr juarezr closed this as completed Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants