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

Antoine Pitrou resolved ARROW-8773.
-----------------------------------
    Fix Version/s: 2.0.0
       Resolution: Fixed

Issue resolved by pull request 8004
[https://github.com/apache/arrow/pull/8004]

> [Python] pyarrow schema.empty_table() does not preserve nullability of fields
> -----------------------------------------------------------------------------
>
>                 Key: ARROW-8773
>                 URL: https://issues.apache.org/jira/browse/ARROW-8773
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.17.0
>         Environment: linux, pyarrow 0.17.0 installed via pipenv
>            Reporter: Al Taylor
>            Assignee: Krisztian Szucs
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.0.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Introduced by PR: [https://github.com/apache/arrow/pull/2589]
>  
> When a field in a schema is marked as not-nullable, calling empty_table() on 
> the schema returns a table with nullable fields.
>  
> reproduction
> {code:java}
> >>> import pyarrow as pa
> >>> s = pa.schema([pa.field('a', pa.int64(), nullable=False), pa.field('b', 
> >>> pa.int64())])
> >>> s
> a: int64 not null
> b: int64
> >>> e = s.empty_table()
> >>> e
> pyarrow.Table
> a: int64
> b: int64
> >>> e.schema
> a: int64
> b: int64
> >>> assert s == e.schema
> Traceback (most recent call last):
>   File "<input>", line 1, in <module>
> AssertionError
> {code}



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

Reply via email to