title: pyarrow.lib.ArrowInvalid: ('Could not convert X with type Y: did not recognize Python value type when inferring an Arrow data type')
body: <p>Using <code>pyarrow</code> to convert a <code>pandas.DataFrame</code> containing <code>Player</code> objects to a <code>pyarrow.Table</code> with the following code</p>
  
  <pre><code>import pandas as pd
  import pyarrow as pa
  
  class Player:
      def __init__(self, name, age, gender):
          self.name = name
          self.age = age
          self.gender = gender
  
      def __repr__(self):
          return f'&lt;{self.name} ({self.age})&gt;'
  
  data = [
      Player('Jack', 21, 'm'),
      Player('Ryan', 18, 'm'),
      Player('Jane', 35, 'f'),
  ]
  df = pd.DataFrame(data, columns=['player'])
  print(pa.Table.from_pandas(df))
  </code></pre>
  
  <p>we get the error:</p>
  
  <pre><code>pyarrow.lib.ArrowInvalid: ('Could not convert &lt;Jack (21)&gt; with type Player: did not recognize Python value type when inferring an Arrow data type', 'Conversion failed for column 0 with type object')
  </code></pre>
  
  <p>Same error encountered by using</p>
  
  <pre><code>df.to_parquet('players.pq')
  </code></pre>
  
  <p>Is it possible for <code>pyarrow</code> to fallback to serializing these Python objects using <code>pickle</code>? Or is there a better solution? The <code>pyarrow.Table</code> will eventually be written to disk using <code>Parquet.write_table()</code>.</p>
  
  <ul>
  <li><em>Using Python 3.8.0, pandas 0.25.3, pyarrow 0.13.0.</em></li>
  <li><em><code>pandas.DataFrame.to_parquet()</code> does not support multi index, so a solution using <code>pq.write_table(pa.Table.from_dataframe(pandas.DataFrame))</code> is preferred.</em></li>
  </ul>
  
  <p>Thank you!</p>