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] pyarrow schema.empty_table() does not preserve nullability of fields #24920

Closed
asfimport opened this issue May 12, 2020 · 2 comments
Closed

Comments

@asfimport
Copy link

Introduced by PR: #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

>>> 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

Environment: linux, pyarrow 0.17.0 installed via pipenv
Reporter: Al Taylor
Assignee: Krisztian Szucs / @kszucs

PRs and other links:

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

@asfimport
Copy link
Author

Joris Van den Bossche / @jorisvandenbossche:
[~Al Taylor] Thanks for the report.
That's indeed something that should be preserved in the empty_table() method.

A PR to fix this is always welcome!

@asfimport
Copy link
Author

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

@asfimport asfimport added this to the 2.0.0 milestone Jan 11, 2023
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

2 participants