You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Eduardo Ponce (Jira)" <ji...@apache.org> on 2021/09/21 16:21:00 UTC

[jira] [Updated] (ARROW-14058) [Python] Update use of FunctionOptions scoped enums once Cython 3 is supported

     [ https://issues.apache.org/jira/browse/ARROW-14058?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eduardo Ponce updated ARROW-14058:
----------------------------------
    Description: 
In [_pyarrow/_compute.pyx_|https://github.com/apache/arrow/blob/master/python/pyarrow/_compute.pyx] there are several scoped enums for FunctionOptions (e.g., RoundMode and SortOrder) which are not used in dictionaries but rather with a chain of if-elses because scoped enums are not fully supported in Cython >= 0.29.x since they do not resolve to an underlying integral type. We would like to be consistent with the use of other FunctionOptions and use a dictionary when mapping string input to enum constant.

In order for the above to work in Cython 3, we also need to update the definition of the scoped enums found in [_pyarrow/includes/libarrow.pxd_|https://github.com/apache/arrow/blob/master/python/pyarrow/includes/libarrow.pxd] to the form of
{code:c++}
cpdef enum class CRoundMode(int8_t)
{code}

[Reference to Cython 3 soped enum|    # https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html#scoped-enumerations]

  was:
In [_pyarrow/_compute.pyx_|https://github.com/apache/arrow/blob/master/python/pyarrow/_compute.pyx] there are several scoped enums for FunctionOptions (e.g., RoundMode and SortOrder) which are not used in dictionaries but rather with a chain of if-elses because scoped enums are not fully supported in Cython >= 0.29.x since they do not resolve to an underlying integral type. We would like to be consistent with the use of other FunctionOptions and use a dictionary when mapping string input to enum constant.

In order for the above to work in Cython 3, we also need to update the definition of the scoped enums found in [_pyarrow/includes/libarrow.pxd_|] to the form of
{code:c++}
cpdef enum class CRoundMode(int8_t)
{code}


> [Python] Update use of FunctionOptions scoped enums once Cython 3 is supported
> ------------------------------------------------------------------------------
>
>                 Key: ARROW-14058
>                 URL: https://issues.apache.org/jira/browse/ARROW-14058
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Eduardo Ponce
>            Priority: Minor
>
> In [_pyarrow/_compute.pyx_|https://github.com/apache/arrow/blob/master/python/pyarrow/_compute.pyx] there are several scoped enums for FunctionOptions (e.g., RoundMode and SortOrder) which are not used in dictionaries but rather with a chain of if-elses because scoped enums are not fully supported in Cython >= 0.29.x since they do not resolve to an underlying integral type. We would like to be consistent with the use of other FunctionOptions and use a dictionary when mapping string input to enum constant.
> In order for the above to work in Cython 3, we also need to update the definition of the scoped enums found in [_pyarrow/includes/libarrow.pxd_|https://github.com/apache/arrow/blob/master/python/pyarrow/includes/libarrow.pxd] to the form of
> {code:c++}
> cpdef enum class CRoundMode(int8_t)
> {code}
> [Reference to Cython 3 soped enum|    # https://cython.readthedocs.io/en/latest/src/userguide/wrapping_CPlusPlus.html#scoped-enumerations]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)