You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] How to convert list of dicts in Pandas to pyarrow Table? #3804
I tried creating a schema for this a list of struct. But when I do this it is raising an error:
Traceback (most recent call last):
File "test.py", line 47, in <module>
table = pa.Table.from_pandas(df, schema=phone_contacts, preserve_index=False)
File "pyarrow/table.pxi", line 1141, in pyarrow.lib.Table.from_pandas
File "/home/jezeniel/.virtualenvs/data-archive/lib/python3.6/site-packages/pyarrow/pandas_compat.py", line 443, in dataframe_to_arrays
types
File "/home/jezeniel/.virtualenvs/data-archive/lib/python3.6/site-packages/pyarrow/pandas_compat.py", line 217, in construct_metadata
df.columns, column_names, df_types
File "/home/jezeniel/.virtualenvs/data-archive/lib/python3.6/site-packages/pyarrow/pandas_compat.py", line 216, in <listcomp>
) for col_name, sanitized_name, arrow_type in zip(
File "/home/jezeniel/.virtualenvs/data-archive/lib/python3.6/site-packages/pyarrow/pandas_compat.py", line 160, in get_column_metadata
logical_type = get_logical_type(arrow_type)
File "/home/jezeniel/.virtualenvs/data-archive/lib/python3.6/site-packages/pyarrow/pandas_compat.py", line 87, in get_logical_type
raise NotImplementedError(str(arrow_type))
NotImplementedError: struct<number: string, number_normalized: string>
Is there a way to convert this structure? or currently it is impossible?
Activity
wesm commentedon Mar 5, 2019
Can you please open a JIRA issue? It would be great if you could include the
phone_schemadeclaration also