-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-13208: [Python][CI] Create a build for validating python docstrings #7732
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
Changes from all commits
cc771ae
c32d9c4
2e9c59d
97f8ca5
043eb19
fa290cb
a5c1457
0969c58
b493540
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,7 @@ | |
| 'setuptools_scm'], | ||
| 'crossbow-upload': ['github3.py', jinja_req, 'ruamel.yaml', | ||
| 'setuptools_scm'], | ||
| 'numpydoc': ['numpydoc==1.1.0'] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a particular reason for pinning to this exact version?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This it the first version which provides the class and function we use from numpydoc which seem a bit like internal-ish at the moment. |
||
| } | ||
| extras['bot'] = extras['crossbow'] + ['pygithub', 'jira'] | ||
| extras['all'] = list(set(functools.reduce(operator.add, extras.values()))) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,6 +78,7 @@ from pyarrow.includes.libgandiva cimport ( | |
| CFunctionSignature, | ||
| GetRegisteredFunctionSignatures) | ||
|
|
||
|
|
||
| cdef class Node(_Weakrefable): | ||
| cdef: | ||
| shared_ptr[CNode] node | ||
|
|
@@ -103,6 +104,7 @@ cdef class Node(_Weakrefable): | |
| def return_type(self): | ||
| return pyarrow_wrap_data_type(self.node.get().return_type()) | ||
|
|
||
|
|
||
| cdef class Expression(_Weakrefable): | ||
| cdef: | ||
| shared_ptr[CExpression] expression | ||
|
|
@@ -123,6 +125,7 @@ cdef class Expression(_Weakrefable): | |
| def result(self): | ||
| return pyarrow_wrap_field(self.expression.get().result()) | ||
|
|
||
|
|
||
| cdef class Condition(_Weakrefable): | ||
| cdef: | ||
| shared_ptr[CCondition] condition | ||
|
|
@@ -151,6 +154,7 @@ cdef class Condition(_Weakrefable): | |
| def result(self): | ||
| return pyarrow_wrap_field(self.condition.get().result()) | ||
|
|
||
|
|
||
| cdef class SelectionVector(_Weakrefable): | ||
| cdef: | ||
| shared_ptr[CSelectionVector] selection_vector | ||
|
|
@@ -169,6 +173,7 @@ cdef class SelectionVector(_Weakrefable): | |
| cdef shared_ptr[CArray] result = self.selection_vector.get().ToArray() | ||
| return pyarrow_wrap_array(result) | ||
|
|
||
|
|
||
| cdef class Projector(_Weakrefable): | ||
| cdef: | ||
| shared_ptr[CProjector] projector | ||
|
|
@@ -206,6 +211,7 @@ cdef class Projector(_Weakrefable): | |
| arrays.append(pyarrow_wrap_array(result)) | ||
| return arrays | ||
|
|
||
|
|
||
| cdef class Filter(_Weakrefable): | ||
| cdef: | ||
| shared_ptr[CFilter] filter | ||
|
|
@@ -440,26 +446,70 @@ cdef class TreeExprBuilder(_Weakrefable): | |
| condition.node) | ||
| return Condition.create(r) | ||
|
|
||
|
|
||
| cpdef make_projector(Schema schema, children, MemoryPool pool, | ||
| str selection_mode="NONE"): | ||
| cdef c_vector[shared_ptr[CExpression]] c_children | ||
| cdef Expression child | ||
| """ | ||
| Construct a projection using expressions. | ||
|
|
||
| A projector is built for a specific schema and vector of expressions. | ||
| Once the projector is built, it can be used to evaluate many row batches. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| schema : pyarrow.Schema | ||
| Schema for the record batches, and the expressions. | ||
| children : list[pyarrow.gandiva.Expression] | ||
| List of projectable expression objects. | ||
| pool : pyarrow.MemoryPool | ||
| Memory pool used to allocate output arrays. | ||
| selection_mode : str, default "NONE" | ||
| Possible values are NONE, UINT16, UINT32, UINT64. | ||
|
|
||
| Returns | ||
| ------- | ||
| Projector instance | ||
| """ | ||
| cdef: | ||
| Expression child | ||
| c_vector[shared_ptr[CExpression]] c_children | ||
| shared_ptr[CProjector] result | ||
|
|
||
| for child in children: | ||
| c_children.push_back(child.expression) | ||
| cdef shared_ptr[CProjector] result | ||
|
|
||
| check_status( | ||
| Projector_Make(schema.sp_schema, c_children, | ||
| _ensure_selection_mode(selection_mode), | ||
| CConfigurationBuilder.DefaultConfiguration(), | ||
| &result)) | ||
| return Projector.create(result, pool) | ||
|
|
||
|
|
||
| cpdef make_filter(Schema schema, Condition condition): | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These functions are only used from the unittest, so we should not expose them to the public API. Created a follow-up https://issues.apache.org/jira/browse/ARROW-14996 |
||
| """ | ||
| Contruct a filter based on a condition. | ||
|
|
||
| A filter is built for a specific schema and condition. Once the filter is | ||
| built, it can be used to evaluate many row batches. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| schema : pyarrow.Schema | ||
| Schema for the record batches, and the condition. | ||
| condition : pyarrow.gandiva.Condition | ||
| Filter condition. | ||
|
|
||
| Returns | ||
| ------- | ||
| Filter instance | ||
| """ | ||
| cdef shared_ptr[CFilter] result | ||
| check_status( | ||
| Filter_Make(schema.sp_schema, condition.condition, &result)) | ||
| return Filter.create(result) | ||
|
|
||
|
|
||
| cdef class FunctionSignature(_Weakrefable): | ||
| """ | ||
| Signature of a Gandiva function including name, parameter types | ||
|
|
||
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.
Temporarily disabled, created a follow-up: https://issues.apache.org/jira/browse/ARROW-14995