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

[Python] Schema.from_pandas breaks with pandas nullable integer dtype

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 0.15.0, 0.15.1, 0.16.0
    • 0.17.0
    • Python
    • pyarrow 0.16

    Description

       

      import pandas as pd
      import pyarrow as pa
      df = pd.DataFrame([{'int_col':1},
       {'int_col':2}])
      df['int_col'] = df['int_col'].astype(pd.Int64Dtype())
      
      schema = pa.Schema.from_pandas(df)
      

      produces ArrowTypeError: Did not pass numpy.dtype object

       

      However, this works fine 

      schema = pa.Table.from_pandas(df).schema

      Attachments

        Issue Links

          Activity

            People

              uwe Uwe Korn
              Ged.Steponavicius Ged Steponavicius
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: