Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-8773

[Python] pyarrow schema.empty_table() does not preserve nullability of fields

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.17.0
    • 2.0.0
    • Python
    • linux, pyarrow 0.17.0 installed via pipenv

    Description

      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

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

      Attachments

        Issue Links

          Activity

            People

              kszucs Krisztian Szucs
              Al Taylor Al Taylor
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h