-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Add back __array_wrap__ for dask compatibility #45451
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
Conversation
pandas/tests/base/test_misc.py
Outdated
# (https://github.com/dask/dask/issues/8580). | ||
# This test is a small dummy ensuring coverage | ||
orig = Series([1, 2, 3], index=["a", "b", "c"]) | ||
result = orig.__array_wrap__(np.array([2, 4, 6])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an actual use case where this gets called organically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose only with old numpy? (not really an idea though) But so in dask's case they are calling it explicitly / manually (like this test does)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then wouldn't the reasonable thing to do be either a) see if they really need to call it or b) add a "real" test in test_downstream?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see if they really need to call it
They don't need to, and are already fixing it (but we should still do this PR to not directly break released dask IMO, and I can open an issue to remove it in a year or so, or we can first deprecate it)
add a "real" test in test_downstream?
I would say that the "real" test is downstream in dask's test suite :)
In the end I don't really care where the test is put, but I think putting it here without usage of dask is useful (I think the dowstream tests are much easier to miss while developing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a downstream dask test, but also kept this one.
Will do a follow-up PR to add a deprecation warning for 1.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up PR to deprecate it -> #45517
lots of things failing here, can you merge master |
@@ -55,6 +55,30 @@ def test_dask(df): | |||
pd.set_option("compute.use_numexpr", olduse) | |||
|
|||
|
|||
@pytest.mark.filterwarnings("ignore:.*64Index is deprecated:FutureWarning") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you use the import decorator here e.g. @td.skip_if_no("xarray"
(and can you fix the L39 one
i also don't know why we have a special import_module here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be done on purpose:
pandas/pandas/tests/test_downstream.py
Lines 23 to 30 in 4ce84de
def import_module(name): | |
# we *only* want to skip if the module is truly not available | |
# and NOT just an actual import error because of pandas changes | |
try: | |
return importlib.import_module(name) | |
except ModuleNotFoundError: | |
pytest.skip(f"skipping as {name} not available") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok really this should be cleaned up cc @jbrockmendel
@meeseeksdev backport 1.4.x |
Something went wrong ... Please have a look at my logs. |
…45491) Co-authored-by: Joris Van den Bossche <[email protected]>
xref https://github.com/pandas-dev/pandas/pull/44006/files#r786627658