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
Table.from_pandas sets empty string columns to null type #2110
This is sadly a known limitation of the type inferrence from empty DataFrames. These columns in Pandas DataFrames are from type object, not str. This column could also contain datetime.date or list objects when filled. Thus we are unable to guess the correct dtype from the existing Pandas DataFrame. null is the most common type we can guess for all of them.
I'm closing this as we cannot fix this as long as Pandas DataFrames don't carry more schema information than the NumPy dtype.
Feel free to ask again if I could not clarify why this is impossible to fix from the Arrow side.
On Thu, 7 Jun 2018 at 10:31 Uwe L. Korn ***@***.***> wrote:
This is sadly a known limitation of the type inferrence from empty
DataFrames. These columns in Pandas DataFrames are from type object, not
str. This column could also contain datetime.date or list objects when
filled. Thus we are unable to guess the correct dtype from the existing
Pandas DataFrame. null is the most common type we can guess for all of
them.
I'm closing this as we cannot fix this as long as Pandas DataFrames don't
carry more schema information than the NumPy dtype.
Feel free to ask again if I could not clarify why this is impossible to
fix from the Arrow side.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2110 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AGF_bN87g_h8tSRA0z-H3Gmn5P-Jcno2ks5t6PL2gaJpZM4UcN7u>
.
@xhochy I'm still having issues with pyarrow. I have no issues writing the parquet files but when I try to read them back using Dask I get an error saying that the schema is different between the common metadata and the other partitions. When I individually read in each parquet partition, however, the resulting pyarrow table has the correct schema (I am specifying a schema when I write the files, but the string vs null column type is being ignored).
Activity
xhochy commentedon Jun 7, 2018
This is sadly a known limitation of the type inferrence from empty DataFrames. These columns in Pandas DataFrames are from type
object, notstr. This column could also containdatetime.dateorlistobjects when filled. Thus we are unable to guess the correct dtype from the existing Pandas DataFrame.nullis the most common type we can guess for all of them.I'm closing this as we cannot fix this as long as Pandas DataFrames don't carry more schema information than the NumPy dtype.
Feel free to ask again if I could not clarify why this is impossible to fix from the Arrow side.
ja-michel commentedon Jun 7, 2018
wesm commentedon Jun 7, 2018
Perhaps we should add documentation how a user can supply column types for such columns to skip the inference.
ja-michel commentedon Jun 7, 2018
xhochy commentedon Jun 8, 2018
@arturomichel I added some documentation: #2116
gsakkis commentedon Aug 14, 2018
This looks related to dask/dask#3454; is it something to be fixed on the dask or pyarrow side? I can open a new issue if it's the latter.
xhochy commentedon Aug 19, 2018
@gsakkis This is https://issues.apache.org/jira/browse/ARROW-2860 and should be fixed in
pyarrow.ak-gupta commentedon Sep 8, 2018
@xhochy I'm still having issues with
pyarrow. I have no issues writing the parquet files but when I try to read them back using Dask I get an error saying that the schema is different between the common metadata and the other partitions. When I individually read in each parquet partition, however, the resulting pyarrow table has the correct schema (I am specifying a schema when I write the files, but the string vs null column type is being ignored).wesm commentedon Sep 8, 2018
@ak-gupta this isn't the best place for this discussion. Can you open a JIRA issue for Arrow and preferably post a reproducible example? Thanks
ikucan commentedon Apr 6, 2020
Sorry, was this ever resolved. I have come across this issue
wesm commentedon Apr 6, 2020
If you're having the issue with pyarrow 0.16.0 please open a JIRA issue