You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2020/06/25 13:42:00 UTC

[jira] [Updated] (ARROW-9017) [Python] Refactor the Scalar classes

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

Joris Van den Bossche updated ARROW-9017:
-----------------------------------------
    Fix Version/s: 1.0.0

> [Python] Refactor the Scalar classes
> ------------------------------------
>
>                 Key: ARROW-9017
>                 URL: https://issues.apache.org/jira/browse/ARROW-9017
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Joris Van den Bossche
>            Assignee: Krisztian Szucs
>            Priority: Major
>             Fix For: 1.0.0
>
>
> The situation regarding scalars in Python is currently not optimal.
> We have two different "types" of scalars:
> - {{ArrayValue(Scalar)}} (and subclasses of that for all types):  this is used when you access a single element of an array (eg {{arr[0]}})
> - {{ScalarValue(Scalar)}} (and subclasses of that for _some_ types): this is used when wrapping a C++ scalar into a python scalar, eg when you get back a scalar from a reduction like {{arr.sum()}}.
> And while we have two versions of scalars, neither of them can actually easily be used as scalar as they both can't be constructed from a python scalar (there is no {{scalar(1)}} function to use when calling a kernel, for example).
> I think we should try to unify those scalar classes? (which probably means getting rid of the ArrayValue scalar)
> In addition, there is an issue of trying to re-use python scalar <-> arrow conversion code, as this is also logic for this in the {{python_to_arrow.cc}} code. But this is probably a bigger change. cc [~kszucs] 



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