You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Aaron Chu <xw...@ucsc.edu.INVALID> on 2019/11/28 05:41:54 UTC

Re: PyArrow.Table schema.metadata issue

Dear all,

I need your help regarding the pyarrow.table.schema.

I tried to create a schema and use with_metadata/add_metadata functions to
add the metadata (a python dict) to the schema. However, nothing showed up
when I run 'schema.metadata'. I can't get the metadata added to the schema.

This issue can be easily reproduced on python2 and 3:

import pyarrow as pa
schema = pa.schema([pa.field('Event_ID', pa.int64())])
meta = {}
meta['test'] = 'testval'
schema.add_metadata(meta)
#schema.with_metadata(meta)
schema.metadata

Thanks for your help!!

Best Regards,
Aaron Chu


On Wed, Nov 27, 2019 at 9:37 PM Aaron Chu <xw...@ucsc.edu> wrote:

> Dear all,
>
> I need your help regarding the pyarrow.table.schema.
>
> I tried to create a schema and use with_metadata/add_metadata functions to
> add the metadata (a python dict) to the schema. However, nothing showed up
> when I run 'schema.metadata'. I can't get the metadata added to the schema.
>
> This issue can be easily reproduced on python2 and 3:
>
> import pyarrow as pa
> schema = pa.schema([pa.field('Event_ID', pa.int64())])
> meta = {}
> meta['test'] = 'testval'
> schema.add_metadata(meta)
> #schema.with_metadata(meta)
> schema.metadata
>
> Thanks for your help!!
>
> Best Regards,
> Aaron Chu
>

Re: PyArrow.Table schema.metadata issue

Posted by Aaron Chu <xw...@ucsc.edu>.
Thanks Maarten,

It works. You're really helpfull. Thanks again.

Best Regards,
Aaron Chu


On Wed, Nov 27, 2019 at 10:18 PM Maarten Ballintijn <ma...@xs4all.nl>
wrote:

> Hi Aaron,
>
> The schema is immutable, add_metadata returns a new schema object which
> includes the metadata.
> So I think this does what you want:
>
> schema = schema.add_metadata(meta)
>
> If not, experts will chime in hopefully.
>
> Cheers,
> Maarten.
>
>
>
> On Nov 28, 2019, at 12:41 AM, Aaron Chu <xw...@ucsc.edu> wrote:
>
> Dear all,
>
> I need your help regarding the pyarrow.table.schema.
>
> I tried to create a schema and use with_metadata/add_metadata functions to
> add the metadata (a python dict) to the schema. However, nothing showed up
> when I run 'schema.metadata'. I can't get the metadata added to the schema.
>
> This issue can be easily reproduced on python2 and 3:
>
> import pyarrow as pa
> schema = pa.schema([pa.field('Event_ID', pa.int64())])
> meta = {}
> meta['test'] = 'testval'
> schema.add_metadata(meta)
> #schema.with_metadata(meta)
> schema.metadata
>
> Thanks for your help!!
>
> Best Regards,
> Aaron Chu
>
>
> On Wed, Nov 27, 2019 at 9:37 PM Aaron Chu <xw...@ucsc.edu> wrote:
>
>> Dear all,
>>
>> I need your help regarding the pyarrow.table.schema.
>>
>> I tried to create a schema and use with_metadata/add_metadata functions
>> to add the metadata (a python dict) to the schema. However, nothing showed
>> up when I run 'schema.metadata'. I can't get the metadata added to the
>> schema.
>>
>> This issue can be easily reproduced on python2 and 3:
>>
>> import pyarrow as pa
>> schema = pa.schema([pa.field('Event_ID', pa.int64())])
>> meta = {}
>> meta['test'] = 'testval'
>> schema.add_metadata(meta)
>> #schema.with_metadata(meta)
>> schema.metadata
>>
>> Thanks for your help!!
>>
>> Best Regards,
>> Aaron Chu
>>
>
>

Re: PyArrow.Table schema.metadata issue

Posted by Aaron Chu <xw...@ucsc.edu.INVALID>.
Thanks Maarten,

It works. You're really helpfull. Thanks again.

Best Regards,
Aaron Chu


On Wed, Nov 27, 2019 at 10:18 PM Maarten Ballintijn <ma...@xs4all.nl>
wrote:

> Hi Aaron,
>
> The schema is immutable, add_metadata returns a new schema object which
> includes the metadata.
> So I think this does what you want:
>
> schema = schema.add_metadata(meta)
>
> If not, experts will chime in hopefully.
>
> Cheers,
> Maarten.
>
>
>
> On Nov 28, 2019, at 12:41 AM, Aaron Chu <xw...@ucsc.edu> wrote:
>
> Dear all,
>
> I need your help regarding the pyarrow.table.schema.
>
> I tried to create a schema and use with_metadata/add_metadata functions to
> add the metadata (a python dict) to the schema. However, nothing showed up
> when I run 'schema.metadata'. I can't get the metadata added to the schema.
>
> This issue can be easily reproduced on python2 and 3:
>
> import pyarrow as pa
> schema = pa.schema([pa.field('Event_ID', pa.int64())])
> meta = {}
> meta['test'] = 'testval'
> schema.add_metadata(meta)
> #schema.with_metadata(meta)
> schema.metadata
>
> Thanks for your help!!
>
> Best Regards,
> Aaron Chu
>
>
> On Wed, Nov 27, 2019 at 9:37 PM Aaron Chu <xw...@ucsc.edu> wrote:
>
>> Dear all,
>>
>> I need your help regarding the pyarrow.table.schema.
>>
>> I tried to create a schema and use with_metadata/add_metadata functions
>> to add the metadata (a python dict) to the schema. However, nothing showed
>> up when I run 'schema.metadata'. I can't get the metadata added to the
>> schema.
>>
>> This issue can be easily reproduced on python2 and 3:
>>
>> import pyarrow as pa
>> schema = pa.schema([pa.field('Event_ID', pa.int64())])
>> meta = {}
>> meta['test'] = 'testval'
>> schema.add_metadata(meta)
>> #schema.with_metadata(meta)
>> schema.metadata
>>
>> Thanks for your help!!
>>
>> Best Regards,
>> Aaron Chu
>>
>
>

Re: PyArrow.Table schema.metadata issue

Posted by Maarten Ballintijn <ma...@xs4all.nl>.
Hi Aaron,

The schema is immutable, add_metadata returns a new schema object which includes the metadata.
So I think this does what you want:

schema = schema.add_metadata(meta)

If not, experts will chime in hopefully.

Cheers,
Maarten.



> On Nov 28, 2019, at 12:41 AM, Aaron Chu <xw...@ucsc.edu> wrote:
> 
> Dear all,
> 
> I need your help regarding the pyarrow.table.schema. 
> 
> I tried to create a schema and use with_metadata/add_metadata functions to add the metadata (a python dict) to the schema. However, nothing showed up when I run 'schema.metadata'. I can't get the metadata added to the schema. 
> 
> This issue can be easily reproduced on python2 and 3:
> 
> import pyarrow as pa
> schema = pa.schema([pa.field('Event_ID', pa.int64())])
> meta = {}
> meta['test'] = 'testval'
> schema.add_metadata(meta)
> #schema.with_metadata(meta)
> schema.metadata
> 
> Thanks for your help!!
> 
> Best Regards,
> Aaron Chu
> 
> 
> On Wed, Nov 27, 2019 at 9:37 PM Aaron Chu <xweichu@ucsc.edu <ma...@ucsc.edu>> wrote:
> Dear all,
> 
> I need your help regarding the pyarrow.table.schema. 
> 
> I tried to create a schema and use with_metadata/add_metadata functions to add the metadata (a python dict) to the schema. However, nothing showed up when I run 'schema.metadata'. I can't get the metadata added to the schema. 
> 
> This issue can be easily reproduced on python2 and 3:
> 
> import pyarrow as pa
> schema = pa.schema([pa.field('Event_ID', pa.int64())])
> meta = {}
> meta['test'] = 'testval'
> schema.add_metadata(meta)
> #schema.with_metadata(meta)
> schema.metadata
> 
> Thanks for your help!!
> 
> Best Regards,
> Aaron Chu


Re: PyArrow.Table schema.metadata issue

Posted by Maarten Ballintijn <ma...@xs4all.nl>.
Hi Aaron,

The schema is immutable, add_metadata returns a new schema object which includes the metadata.
So I think this does what you want:

schema = schema.add_metadata(meta)

If not, experts will chime in hopefully.

Cheers,
Maarten.



> On Nov 28, 2019, at 12:41 AM, Aaron Chu <xw...@ucsc.edu> wrote:
> 
> Dear all,
> 
> I need your help regarding the pyarrow.table.schema. 
> 
> I tried to create a schema and use with_metadata/add_metadata functions to add the metadata (a python dict) to the schema. However, nothing showed up when I run 'schema.metadata'. I can't get the metadata added to the schema. 
> 
> This issue can be easily reproduced on python2 and 3:
> 
> import pyarrow as pa
> schema = pa.schema([pa.field('Event_ID', pa.int64())])
> meta = {}
> meta['test'] = 'testval'
> schema.add_metadata(meta)
> #schema.with_metadata(meta)
> schema.metadata
> 
> Thanks for your help!!
> 
> Best Regards,
> Aaron Chu
> 
> 
> On Wed, Nov 27, 2019 at 9:37 PM Aaron Chu <xweichu@ucsc.edu <ma...@ucsc.edu>> wrote:
> Dear all,
> 
> I need your help regarding the pyarrow.table.schema. 
> 
> I tried to create a schema and use with_metadata/add_metadata functions to add the metadata (a python dict) to the schema. However, nothing showed up when I run 'schema.metadata'. I can't get the metadata added to the schema. 
> 
> This issue can be easily reproduced on python2 and 3:
> 
> import pyarrow as pa
> schema = pa.schema([pa.field('Event_ID', pa.int64())])
> meta = {}
> meta['test'] = 'testval'
> schema.add_metadata(meta)
> #schema.with_metadata(meta)
> schema.metadata
> 
> Thanks for your help!!
> 
> Best Regards,
> Aaron Chu