ibis-project / ibis

the portable Python dataframe library
https://ibis-project.org
Apache License 2.0
5.29k stars 596 forks source link

refactor: separate out pandas and pyarrow usage/imports #10166

Open gforsyth opened 1 month ago

gforsyth commented 1 month ago

Today, you can install ibis-framework and generate expressions and compile to any of our backends without installing any of the backend-specific libraries.

However, if you want to actually execute that expression, and get data back, you need pandas and pyarrow installed.
We should separate out and isolate those imports, such that someone could attempt to use only one-or-the-other, or a separate method of pulling data back (like the pycapsule interface), without having those dependencies installed.

We would not be removing them as required imports, because that would make for a bad user-experience when people are getting started, but it would allow for users to explicitly install or uninstall dependencies they don't want, while maintaining other functionality.

xref #10120

MarcoGorelli commented 1 month ago

thanks @gforsyth for considering this!

would it be feasible to aim for something like:

?

lostmygithubaccount commented 1 month ago

I believe that's the intention -- then in the first case you'll get import errors for things like t.to_pandas(), but most things should work