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

[Python] NullType.to_pandas_dtype inconsisent with dtype returned in to_pandas/to_numpy

    XMLWordPrintableJSON

Details

    Description

      There is this behaviour of to_pandas_dtype returning float, while all actual conversions to numpy or pandas use object dtype:

      In [23]: pa.null().to_pandas_dtype()                                                                                                                                                                               
      Out[23]: numpy.float64
      
      In [24]: pa.array([], pa.null()).to_pandas()                                                                                                                                                                       
      Out[24]: Series([], dtype: object)
      
      In [25]: pa.array([], pa.null()).to_numpy(zero_copy_only=False)                                                                                                                                                    
      Out[25]: array([], dtype=object)
      

      So we should probably fix NullType.to_pandas_dtype to return object, which is used in practice.

      Attachments

        Issue Links

          Activity

            People

              jorisvandenbossche Joris Van den Bossche
              jorisvandenbossche Joris Van den Bossche
              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 - 50m
                  50m