Uh oh!
There was an error while loading. Please reload this page.
ARROW-9967: [Python] Add compute module docs + expose more option classes - #8145
ARROW-9967: [Python] Add compute module docs + expose more option classes#8145arw2019 wants to merge 18 commits into
Conversation
Thanks for opening a pull request! Could you open an issue for this pull request on JIRA? Then could you also rename pull request title in the following format? See also: |
edb57cc to
3f99ae8CompareThere was a problem hiding this comment.
Noticed that this was missing on the c++ page
There was a problem hiding this comment.
Ah, thank you! However, can you leave the table alphabetically-sorted?
There was a problem hiding this comment.
Actually my bad, you already had it there. Reverted
jorisvandenbossche
commented
Sep 14, 2020
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
this is not really a transform?
There was a problem hiding this comment.
Yeah that's fair. Would Structural Transforms be a good place for it?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
this array is not used? (maybe show pc.equals(a, b) ?)
e79559c to
d117ed1CompareThere was a problem hiding this comment.
AFAIK we can't have methods named and and or in Python. For now I went with and_ and or_ here, for consistency with and_kleene and or_kleene, but for example numpy uses np.logical_and and np.logical_or
There was a problem hiding this comment.
We already have a function named "and":
>>>frompyarrowimportcompute>>>getattr(compute, "and")
<functionpyarrow.compute.and(left, right, *, memory_pool=None)>So you should just fix compute.py so that it's exported as and_.
There was a problem hiding this comment.
I think so. It's what's done on the other pages:
https://github.com/apache/arrow/blob/master/docs/source/python/api/datatypes.rst
I'm having trouble building the docs locally (related to ARROW-10018 I think) so haven't been able to check
There was a problem hiding this comment.
This won't render the docstring here, but it will create a separate page for each of those functions and link to that from this table.
(the separate pages might be a bit overkill since the docstrings here are often not that informative yet, but it's indeed how we do it for other functions as well)
c2445c1 to
c1c5846Comparearw2019
commented
Sep 17, 2020
Question: in 952649d I'm attempting to expose This is needed to make the |
pitrou
commented
Sep 21, 2020
Cython generally doesn't convert implicitly between arbitrary Python objects and C/C++ types, you have to type your code explicitly. Also, it is better to use def__cinit__(self, int64_t pivot):
self.partition_nth_options.reset(new CPartitionNthOptions(pivot)) |
arw2019
commented
Sep 21, 2020
Thanks @pitrou! That was the problem |
arw2019
commented
Sep 22, 2020
This is ready for re-review. I believe that I've addressed the feedback from previous reviews. I've also now exposed all the option classes so that all the kernels listed in the docs are usable from Python. |
There was a problem hiding this comment.
@jorisvandenbossche Will this work? I'm not 100% sure as I haven't yet compiled the docs to explicitly check
There was a problem hiding this comment.
I'm not sure why unique_ptr is used in some of the other classes, but it shouldn't be necessary. See MinMaxOptions for an example without.
There was a problem hiding this comment.
In PartitionNthOptions we need it because it doesn't have a null constructor so it can't be allocated on the stack. That's not the case for VarianceOptions, though, so I'll take a look
There was a problem hiding this comment.
I've rewritten VarianceOptions without unique_ptr.
I think that with the other three options classes exposed in this PR (SetLookupOptions, PartitionNthOptions and StrptimeOptions) it's necessary to use unique_ptr or, alternatively, we would need to define default constructors
kszucs
commented
Oct 7, 2020
@github-actions crossbow submit test-ubuntu-18.04-docs |
Revision: 73272bf38f2d8406b60a6ebaa20c5f4e58dff075 Submitted crossbow builds: ursa-labs/crossbow @ actions-615
|
pitrou
commented
Oct 8, 2020
CI failures are unrelated. |
arw2019
commented
Oct 9, 2020
Thanks @pitrou@jorisvandenbossche for reviewing! |
#8163 exposes
pyarrow.computekernels and generates their docstrings. This PR adds documentation for the module in the User Guide and the Python API reference.