Skip to content

Conversation

@TomAugspurger
Copy link
Contributor

We now raise a ValueError when the length of the names doesn't match
the length of the arrays.

In [1]: import pyarrow as pa

In [2]: pa.Table.from_arrays([pa.array([1, 2]), pa.array([3, 4])], names=['a', 'b', 'c'])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-2-cda803f3f774> in <module>()
----> 1 pa.Table.from_arrays([pa.array([1, 2]), pa.array([3, 4])], names=['a', 'b', 'c'])

table.pxi in pyarrow.lib.Table.from_arrays()

table.pxi in pyarrow.lib._schema_from_arrays()

ValueError: Length of names (3) does not match length of arrays (2)

This affected RecordBatch.from_arrays and Table.from_arrays.

We now raise a ValueError when the length of the names doesn't match
the length of the arrays.
Copy link
Member

@wesm wesm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thanks @TomAugspurger!

@wesm
Copy link
Member

wesm commented Sep 20, 2017

Appears there is a test failure that was exposed by this patch, can you fix? https://travis-ci.org/apache/arrow/jobs/277580062#L9653

Change-Id: Ie900ae1dac90e8e8326e22e950dfc7a50803dcd8
@wesm
Copy link
Member

wesm commented Sep 20, 2017

here's a fix to cherry pick wesm@965a560

@TomAugspurger
Copy link
Contributor Author

Sure thing. While we have the chance, on https://github.com/apache/arrow/pull/1117/files#diff-434b799d30eaec7287bee5603a9c45beR318, should that be changed to if not K, since that's already len(arrays)? My intuition is that len is going to be pretty quick anyway, but thought I'd check.

@wesm
Copy link
Member

wesm commented Sep 20, 2017

if not K is probably better, feel free to make that change too

@asfgit asfgit closed this in 9997a1a Sep 20, 2017
@wesm
Copy link
Member

wesm commented Sep 20, 2017

In case it's useful we have nightly dev builds

http://arrow.apache.org/install/index.html#nightly-development-builds

I'd like to get macOS nightlies set up also -- if this is of interest I have a Mac Mini running at home where we could set up a cron job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants