Skip to content

Conversation

lucascolley
Copy link
Contributor

@GPUtester
Copy link
Collaborator

Can one of the admins verify this patch?

Admins can comment ok to test to allow this one PR to run or add to allowlist to allow all future PRs from the same author to run.

@lucascolley
Copy link
Contributor Author

cc @jsignell @jakirkham @jrbourbeau from gh-8106

@lucascolley
Copy link
Contributor Author

Hmm, it looks like from_array does not accept Dask arrays, redirecting to asarray, but in asarray dtype and order are ignored. I suppose we want to coerce the dtype and order from asarray then.

Should I try using Array.astype? And perhaps we don't need to allow changing order?

@lucascolley lucascolley changed the title array: fix asarray for array input with dtype/order array: fix asarray for array input with dtype Aug 8, 2024
@lucascolley
Copy link
Contributor Author

I've hopefully fixed the case of Array input with dtype. Otherwise, I have added the warning:

.. warning::
        `dtype` is ignored if `a` has the attribute ``to_dask_array`` or
        is a list or tuple of `Array`'s.
        `order` is ignored if `a` is an `Array`, has the attribute ``to_dask_array``,
        or is a list or tuple of `Array`'s.

Copy link
Contributor

github-actions bot commented Aug 8, 2024

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

     13 files  ± 0       13 suites  ±0   2h 53m 46s ⏱️ +9s
 13 133 tests + 2   12 065 ✅ + 2   1 068 💤 ±0  0 ❌ ±0 
136 849 runs  +22  117 786 ✅ +23  19 063 💤  - 1  0 ❌ ±0 

Results for commit 03e4edc. ± Comparison against base commit 1ba9c5b.

♻️ This comment has been updated with latest results.

@lucascolley
Copy link
Contributor Author

Currently the warning is below Examples on the docs pages. Not sure if it is possible to move upwards while keeping the admonition.

@phofl phofl merged commit e834543 into dask:main Aug 12, 2024
23 checks passed
@phofl
Copy link
Collaborator

phofl commented Aug 12, 2024

thx

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.

BUG: array.asarray does not respect dtype arg
3 participants