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

[Python] from_numpy_dtype returns wrong types

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.9.0
    • Component/s: Python
    • Environment:
      Windows 10 Build 15063.850
      Python: 3.6.3
      Numpy: 1.14.0

      Description

      The following code shows multiple issues when using from_numpy_dtype:

      import numpy as np
      import pyarrow as pa
      
      pa.from_numpy_dtype(np.unicode) # returns DataType(bool)
      pa.from_numpy_dtype(np.int)     # returns DataType(bool)
      
      pa.from_numpy_dtype(np.int64) # Fails with the following message:
      #
      # ArrowNotImplementedError Traceback (most recent call last)
      # <ipython-input-14-ca0855a7dda8> in <module>()
      # ----> 1 pa.from_numpy_dtype(np.int64)
      # 2
      #
      # types.pxi in pyarrow.lib.from_numpy_dtype()
      #
      # error.pxi in pyarrow.lib.check_status()
      #
      # ArrowNotImplementedError: Unsupported numpy type 32760
      

      Additionally, a potentially related issue is also seen when using to_pandas_dtype:

      pa.DataType.to_pandas_dtype(pa.string()) # Returns numpy.object_ 
                                               # (shouldn't it be numpy.unicode?)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jim.crist Jim Crist
                Reporter:
                betabandido Victor Jimenez
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: