You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/03/15 11:45:00 UTC

[jira] [Commented] (ARROW-2311) [Python] Struct array slicing defective

    [ https://issues.apache.org/jira/browse/ARROW-2311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16400277#comment-16400277 ] 

ASF GitHub Bot commented on ARROW-2311:
---------------------------------------

pitrou opened a new pull request #1754: ARROW-2311: [Python/C++] Fix struct array slicing
URL: https://github.com/apache/arrow/pull/1754
 
 
   `StructArray::field()` would not adjust the offset if the struct array was sliced, requiring error-prone fixup code in the caller.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> [Python] Struct array slicing defective
> ---------------------------------------
>
>                 Key: ARROW-2311
>                 URL: https://issues.apache.org/jira/browse/ARROW-2311
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: C++, Python
>    Affects Versions: 0.8.0
>            Reporter: Antoine Pitrou
>            Assignee: Antoine Pitrou
>            Priority: Major
>              Labels: pull-request-available
>
> {code:python}
> >>> arr = pa.array([(1, 2.0), (3, 4.0), (5, 6.0)], type=pa.struct([pa.field('x', pa.int16()), pa.field('y', pa.float32())]))
> >>> arr
> <pyarrow.lib.StructArray object at 0x7fdfbe7916d8>
> [
>   {'x': 1, 'y': 2.0},
>   {'x': 3, 'y': 4.0},
>   {'x': 5, 'y': 6.0}
> ]
> >>> arr[1:]
> <pyarrow.lib.StructArray object at 0x7fdfbe791f48>
> [
>   {'x': 1, 'y': 2.0},
>   {'x': 3, 'y': 4.0}
> ]
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)