You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2018/12/01 00:54:00 UTC
[jira] [Commented] (ARROW-3866) [Python] Column metadata is not
transferred to tables in pyarrow
[ https://issues.apache.org/jira/browse/ARROW-3866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16705533#comment-16705533 ]
Wes McKinney commented on ARROW-3866:
-------------------------------------
[~kszucs] could you have a look at this?
> [Python] Column metadata is not transferred to tables in pyarrow
> ----------------------------------------------------------------
>
> Key: ARROW-3866
> URL: https://issues.apache.org/jira/browse/ARROW-3866
> Project: Apache Arrow
> Issue Type: Bug
> Components: Python
> Reporter: Seb Fru
> Priority: Major
> Labels: features, newbie
> Fix For: 0.12.0
>
>
> Hello everyone,
> transferring this from Github for Pyarrow. While working with pyarrow I noticed that field metadata does not get carried foreward when creating a table out of several columns. Is this intended behaviour or is there a way to add column metadata later on? The last command in my example does not return anything.
> I also could not verify whether this data would be written to parquet later on, because I could not find a way to add field metadata directly to a table.
>
> {code:java}
> >>>import pyarrow as pa
> >>>import pyarrow.parquet as pq
> >>>arr1 = pa.array([1,2])
> >>>arr2 = pa.array([3,4])
> >>>field1 = pa.field('field1', pa.int64())
> >>>field2 = pa.field('field2', pa.int64())
> >>>field1 = field1.add_metadata({'foo1': 'bar1'})
> >>>field2 = field2.add_metadata({'foo2': 'bar2'})
> >>>field1.metadata {b'foo1': b'bar1'}
> >>>field2.metadata {b'foo2': b'bar2'}
> >>>col1 = pa.column(field1, arr1)
> >>>col2 = pa.column(field2, arr2)
> >>>col1.field.metadata {b'foo1': b'bar1'}
> >>>tab = pa.Table.from_arrays([col1, col2])
> >>>tab pyarrow.Table field1: int64 field2: int64
> >>>tab.column(0).field.metadata
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)