Skip to content

Conversation

@jcrist
Copy link
Member

@jcrist jcrist commented Jan 15, 2019

Calling np.dtype(dask.delayed(...)) used to result in a segfault, as
numpy recursively tries to get dtype from the object. This is likely a
bug in numpy. For now, we can do a dumb check for if x.dtype.dtype is
called (which shouldn't ever show up in real code).

See #4374 (comment).

Calling `np.dtype(dask.delayed(...))` used to result in a segfault, as
numpy recursively tries to get `dtype` from the object. This is likely a
bug in numpy. For now, we can do a dumb for if `x.dtype().dtype()` is
called (which shouldn't ever show up in real code).

See dask#4374 (comment).
Copy link
Member

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, we can do a dumb for if x.dtype().dtype()

When you first said you had a patch in mind, I was worried you'd need to some frame introspection :) This is much better.

And we probably have tests for this, but can you double check that basics of .dtype on a delayed object with an actual dtype are tested still work? Delayed(np.array([])).dtype

@jcrist jcrist merged commit d8756e2 into dask:master Jan 15, 2019
@jcrist jcrist deleted the np_dtype_of_delayed branch January 15, 2019 16:30
jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019
* Calling np.dtype on a delayed object works

Calling `np.dtype(dask.delayed(...))` used to result in a segfault, as
numpy recursively tries to get `dtype` from the object. This is likely a
bug in numpy. For now, we can do a dumb for if `x.dtype().dtype()` is
called (which shouldn't ever show up in real code).

See dask#4374 (comment).

* Add test that dtype attribute still works if computed
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 this pull request may close these issues.

2 participants