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

COMPAT: numpy object array coercion warnings #31201

Closed
AlexKirko opened this issue Jan 22, 2020 · 7 comments · Fixed by #31203
Closed

COMPAT: numpy object array coercion warnings #31201

AlexKirko opened this issue Jan 22, 2020 · 7 comments · Fixed by #31203

Comments

@AlexKirko
Copy link
Member

AlexKirko commented Jan 22, 2020

Problem description

Since at least a couple hours ago, the Numpy Dev pipeline fails 39 tests:

##[error]39 test(s) failed, 60964 test(s) collected.

I checked and all 39 are like this:

numpy.VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray

Full output of one of the tests below.


        True
        >>> a = np.array([(1.0, 2), (3.0, 4)], dtype='f4,i4').view(np.recarray)
        >>> np.asarray(a) is a
        False
        >>> np.asanyarray(a) is a
        True
    
        """
>       return array(a, dtype, copy=False, order=order)
E       numpy.VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray

Thanks to @jreback for pointing out we've run into this before, but Numpy reverted the deprecation warning. The original issue was #30043

@AlexKirko AlexKirko changed the title CI: Numpy Dev Azure pipeline tests fail CI: Numpy Dev Azure pipeline tests fail: deprecated creating an ndarray from ragged nested sequences Jan 22, 2020
@jreback
Copy link
Contributor

jreback commented Jan 22, 2020

this is numpy redoing the object array coercion

cc @jbrockmendel
cc @mattip
cc @seberg

numpy/numpy@287a9d0

there was a previous issue about this if want to find / link

numpy reverted the original commit - this is a redo of it

@jreback jreback changed the title CI: Numpy Dev Azure pipeline tests fail: deprecated creating an ndarray from ragged nested sequences COMPAT: numpy object array coercion warnings Jan 22, 2020
@AlexKirko
Copy link
Member Author

Found the previous issue, I think: #30043. Added to the issue description.

@AlexKirko
Copy link
Member Author

For reference, this is NEP 34, which justified this change.

@AlexKirko
Copy link
Member Author

AlexKirko commented Jan 22, 2020

If anyone wants to take a look, you can check out my error log, while it's still alive. Seems like mostly we directly call np.array or asarray on mixed input, but there is also some stuff in arithmetic operations testing.

@TomAugspurger
Copy link
Contributor

I can take a look at this now.

@jbrockmendel
Copy link
Member

@AlexKirko did there end up being a kwarg like np.asarray(ragged, foo=np.ragged_as_object)?

@seberg
Copy link
Contributor

seberg commented Jan 22, 2020

We did not add the special sentinel because it seemed that all of the (larger) downstream packages are handling fine without it. If you find a place where it would help you, we would add it though.

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

Successfully merging a pull request may close this issue.

5 participants