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

[Python] Cannot create empty StructArray via pa.StructArray.from_arrays

    XMLWordPrintableJSON

Details

    Description

      In [5]: pa.StructArray.from_arrays([], names=[])
      ---------------------------------------------------------------------------
      ValueError                                Traceback (most recent call last)
      <ipython-input-5-d6fa9cf39f31> in <module>
      ----> 1 pa.StructArray.from_arrays([], names=[])
      
      ~/Workspace/arrow/python/pyarrow/array.pxi in pyarrow.lib.StructArray.from_arrays()
         1326         num_arrays = len(arrays)
         1327         if num_arrays == 0:
      -> 1328             raise ValueError("arrays list is empty")
         1329
         1330         length = len(arrays[0])
      
      ValueError: arrays list is empty
      

      however

      pa.array([], type=pa.struct([]))
      

      works

      Attachments

        Issue Links

          Activity

            People

              apitrou Antoine Pitrou
              kszucs Krisztian Szucs
              Votes:
              0 Vote for this issue
              Watchers:
              3 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