Add back __array_wrap__ for dask compatibility#45451
Add back __array_wrap__ for dask compatibility#45451jreback merged 5 commits intopandas-dev:mainfrom
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.
is there an actual use case where this gets called organically?
There was a problem hiding this comment.
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.
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.
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.
Added a downstream dask test, but also kept this one.
Will do a follow-up PR to add a deprecation warning for 1.5
|
lots of things failing here, can you merge master |
| pd.set_option("compute.use_numexpr", olduse) | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings("ignore:.*64Index is deprecated:FutureWarning") |
There was a problem hiding this comment.
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.
This seems to be done on purpose:
pandas/pandas/tests/test_downstream.py
Lines 23 to 30 in 4ce84de
There was a problem hiding this comment.
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 <jorisvandenbossche@gmail.com>
xref https://github.com/pandas-dev/pandas/pull/44006/files#r786627658