Skip to content
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

[Python] Improve consistency of explicit C++ types in PyArrow files #29003

Closed
asfimport opened this issue Jul 13, 2021 · 3 comments
Closed

[Python] Improve consistency of explicit C++ types in PyArrow files #29003

asfimport opened this issue Jul 13, 2021 · 3 comments

Comments

@asfimport
Copy link

asfimport commented Jul 13, 2021

Cython files (.pyx) in PyArrow make inconsistent use of explicit C++ typing. Some methods/functions use explicit types for their parameters and others do not.

Also, definition files (.pxd) are not consistent in the use of the reference operator (&) and may not be up-to-date w.r.t. to C++ API.

Reporter: Eduardo Ponce / @edponce
Assignee: Eduardo Ponce / @edponce

Related issues:

PRs and other links:

Note: This issue was originally created as ARROW-13327. Please see the migration documentation for further details.

@asfimport
Copy link
Author

Eduardo Ponce / @edponce:
Actually, the description files (.pxd) contain the explicit types of the function options' parameters (e.g., SliceOptions in libarrow.pxd), so I do not think it is necessary to add explicit types to the implementation files (.pyx) as currently done for some cases (e.g., SliceOptions in _compute.pyx).

@asfimport
Copy link
Author

Eduardo Ponce / @edponce:
It seems that Cython considers pass-by-reference as default for object types. For example, shared_ptr[T] as shared_ptr[T]&. The ampersand seems to not be required. Nevertheless, it does supports and parses the ampersand so it is best to be consistent with C++ parameter types.

@asfimport
Copy link
Author

Antoine Pitrou / @pitrou:
Issue resolved by pull request 11147
#11147

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant