-
Notifications
You must be signed in to change notification settings - Fork 3.9k
ARROW-4223: [Python] Support scipy.sparse integration #4779
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
Conversation
jorisvandenbossche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rok I know the PR is still indicated as draft, so all comments I made you probably were still going to do, but while looking at the diff, thought to at once comment
5b7472b to
eca7a70
Compare
ff60f58 to
75097f7
Compare
|
I think this is ready for review. |
081032b to
2ca9ed7
Compare
15b973e to
ebbbdf2
Compare
d812904 to
54ad5ad
Compare
|
@ursabot build |
pitrou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of the astype() calls here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a workaround for scipy bug (or lack of feature) see this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But you have if dtype_str != 'f2' above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yeah.. this probably should have failed. That's odd. I'll look into it tonight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
jorisvandenbossche
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit
python/pyarrow/tensor.pxi
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could check here that the passed object is actually a scipy.sparse.coo_matrix ?
(right now the user will probably get an attribute error if you pass a different scipy matrix type)
(and the same for the other from_scipy below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you :)
…or roundtrip test.
|
The R download failure on AppVeyor is unrelated, merging. |
|
Thanks @pitrou @mrkn and @jorisvandenbossche! :) |
This is to resolve [ARROW-4224](https://issues.apache.org/jira/browse/ARROW-4224). Please note this requires #4779 to be reviewed and merged first. Closes #4990 from rok/ARROW-4224 and squashes the following commits: d99d52d <Rok> Implementing review feedback. 4efdd35 <Rok> Adding type check to from_pydata_sparse. 759e0b3 <Rok> Adding from_pydata_sparse and to_pydata_sparse. Authored-by: Rok <rok@mihevc.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
This is to resolve ARROW-4223.