-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
DEPS: Add warning if pyarrow is not installed #56896
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
Changes from 7 commits
bb520d1
a3b3dc3
944c288
613eac7
21509c5
c6ae03d
7b48501
199fb7c
4637a96
aa48e19
9999fe3
3aa3ba9
0074b03
cc2debf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -202,8 +202,40 @@ | |||||
FutureWarning, | ||||||
stacklevel=2, | ||||||
) | ||||||
# Don't allow users to use pandas.os or pandas.warnings | ||||||
del os, warnings | ||||||
|
||||||
# DeprecationWarning for missing pyarrow | ||||||
from pandas.compat.pyarrow import pa_version_under10p1 | ||||||
|
||||||
if pa_version_under10p1: | ||||||
# Check if old pyarrow is installed | ||||||
from pandas.compat._optional import VERSIONS | ||||||
lithomas1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
try: | ||||||
import pyarrow | ||||||
|
||||||
pa_msg = ( | ||||||
f"was too old on your system - pyarrow {VERSIONS['pyarrow']} " | ||||||
"is the current minimum supported version as of this release." | ||||||
) | ||||||
del pyarrow | ||||||
except ImportError: | ||||||
pa_msg = "was not found to be installed on your system." | ||||||
|
||||||
warnings.warn( | ||||||
f""" | ||||||
Pyarrow will become a required dependency of pandas in the next major release of pandas, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think we can be explicit about what this next major release will be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the next major release also the next minor release, i.e., 2.2 then 3.0? I noticed that the dev wheels recently switched to reporting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
No, 2.2 is coming out sometime this week. |
||||||
(to allow more performant data types and better interoperability with other libraries) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would maybe explicitly mention the new default string dtype, since that's still the only one that is used by default that requires pyarrow There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated. |
||||||
but {pa_msg} | ||||||
If this would cause problems for you, | ||||||
please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466 | ||||||
""", | ||||||
DeprecationWarning, | ||||||
stacklevel=2, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to make this stacklevel=1? Because this code is top-level and not inside a function or method, it one less than the typical stacklevel of 2 we use in a direct function/method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warning doesn't pop up in the REPL when I import pandas if I do stacklevel=1. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, OK forget this. I did test it, but should have done something wrong because now I can't reproduce getting the warning with plain import and stacklevel 1 |
||||||
) | ||||||
del VERSIONS | ||||||
|
||||||
# Delete all unnecessary imported modules | ||||||
del pa_version_under10p1, warnings, os | ||||||
|
||||||
# module level doc-string | ||||||
__doc__ = """ | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.