-
Couldn't load subscription status.
- Fork 3.9k
ARROW-3162: Flight Python bindings #3566
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
ghost
commented
Feb 5, 2019
- Add docs
- Format code
- Include Python in integration tests (requires binding the JSON reader/writer from C++)
- Validate performance?
- Complete server bindings if approach makes sense
|
@lihalite glad to see you pushing this along. I think there's a JIRA already for Flight+Python so you can assign yourself that issue. I'll defer to @pitrou on this code review -- if I can be of assistance please ping me and I will make time to review |
Codecov Report
@@ Coverage Diff @@
## master #3566 +/- ##
==========================================
+ Coverage 87.82% 88.67% +0.85%
==========================================
Files 666 537 -129
Lines 82371 73408 -8963
Branches 1069 0 -1069
==========================================
- Hits 72341 65098 -7243
+ Misses 9919 8310 -1609
+ Partials 111 0 -111
Continue to review full report at Codecov.
|
|
Sorry for the delay. I have a flu, but will try to review this shortly. |
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.
I see this PR is still work in progress, so consider this a preliminary review. Thanks for doing this :-)
python/pyarrow/ipc.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.
Why are you defining those two different classes _CRecordBatchReader and _RecordBatchReader?
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.
I will do some more refactoring here, but I'd like to have other bindings of arrow::RecordBatchReader that share the same Python interface. The existing bindings are fairly tied to binding RecordBatchStreamReader even when they don't need to be. Properly, _CRecordBatchReader should be AbstractRecordBatchReader or something similar and _RecordBatchReader should be _RecordBatchStreamReader, if that sounds OK.
python/pyarrow/ipc.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.
Why are you defining those two different classes _CRecordBatchWriter and _RecordBatchWriter?
python/pyarrow/_flight.pyx
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.
Should certainly run without the GIL, no?
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.
Ah good point. One thing I also want to circle back to is this breaks Ctrl-C on the Python side currently.
No worries, hope you feel better soon, and thank you for the comments! |
|
@lihalite Can you rebase on master or would you like help with that? |
|
@xhochy I can, will do so in a moment (sorry, didn't notice what just went in) |
|
I had to squash and rebase due to the CMake file reformatting. I will review this also -- rather than try to boil the ocean in a single PR I suggest fixing any obvious problems with this patch and then opening a bunch of JIRAs so that the remaining work can proceed in parallel |
|
Sounds good, thanks. The one thing I want to fix is the |
|
Okay, if the changes in |
Add simple demo Flight client in Python Add basic docstrings for Python Flight client Move RecordBatchReader/Writer wrappers to lib.pxd Link to PROTOBUF_LIBRARY, not protobuf_static Update for FlightPutWriter Start binding Flight server to Python Allow Flight DoPut to be implemented in Python Revert unnecessary build process changes Fix failing pyarrow unit tests Lint Python flight code Lint Cython code Delete unnecessary Flight pxd Use Arrow utilities for interfacing with Python in Flight Simplify API of Python Flight bindings Add Python enum to mirror DescriptorType in Flight Replace static factory methods with constructors
|
Rebased to fix conflict. |
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.
Looks mostly fine to me. Are you going to submit tests in a separate PR?
python/pyarrow/_flight.pyx
Outdated
| result = (<object> self).get_flight_info(descriptor) | ||
| if not result: | ||
| info.reset(NULL) | ||
| # TODO: |
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.
Is there something missing here and below? I suppose you should convert result to a CFlightInfo?
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.
I haven't finished binding the server methods yet - I'll change this to raise NotImplementedError.
| 'six >= 1.0.0', | ||
| 'futures; python_version < "3.2"' | ||
| 'futures; python_version < "3.2"', | ||
| 'enum34 >= 1.1.6; python_version < "3.4"', |
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.
You must also update requirements.txt.
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!
|
Thanks @lihalite! Seems like there are a number of follow ups, are there JIRA issues for these yet? |
|
I will follow up those now @wesm. Thanks everyone for the help here! |
|
Looks like some have already been filed, here are the relevant issues: https://issues.apache.org/jira/browse/ARROW-3150 (ship wheels) |