ARROW-5790: [Python] Raise error when trying to convert 0-dim array in pa.array#4837
Closed
jorisvandenbossche wants to merge 1 commit intoapache:masterfrom
Closed
ARROW-5790: [Python] Raise error when trying to convert 0-dim array in pa.array#4837jorisvandenbossche wants to merge 1 commit intoapache:masterfrom
jorisvandenbossche wants to merge 1 commit intoapache:masterfrom
Conversation
kszucs
reviewed
Jul 10, 2019
| return Status::Invalid("Input object was not a NumPy array"); | ||
| } | ||
| if (PyArray_NDIM(reinterpret_cast<PyArrayObject*>(ao)) != 1) { | ||
| return Status::Invalid("only handle 1-dimensional arrays"); |
Member
There was a problem hiding this comment.
NumPyConverter::Convert does the check again, but sadly we cannot raise from the constructor, so we'd need a factory to return the Status...
Member
Author
There was a problem hiding this comment.
Actually, that check can probably be removed? (as the NumpyConverter is only used from this function)
kszucs
approved these changes
Jul 10, 2019
Member
|
CI error is unrelated. |
wesm
pushed a commit
that referenced
this pull request
Jul 13, 2019
…n pa.array https://issues.apache.org/jira/browse/ARROW-5790 In the `NumPyConverter` constructor, we access the strides of the array with `PyArray_STRIDES(arr_)[0]`, so need to ensure that the array is 1D before passing it there. Author: Joris Van den Bossche <[email protected]> Closes #4837 from jorisvandenbossche/ARROW-5790 and squashes the following commits: cc66365 <Joris Van den Bossche> ARROW-5790: raise error when trying to convert 0-dim array in pa.array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/ARROW-5790
In the
NumPyConverterconstructor, we access the strides of the array withPyArray_STRIDES(arr_)[0], so need to ensure that the array is 1D before passing it there.