MCPcopy Create free account
hub / github.com/apache/arrow / test_invalid_non_join_column

Function test_invalid_non_join_column

python/pyarrow/tests/test_table.py:3626–3647  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3624
3625@pytest.mark.acero
3626def test_invalid_non_join_column():
3627 NUM_ITEMS = 30
3628 t1 = pa.Table.from_pydict({
3629 'id': range(NUM_ITEMS),
3630 'array_column': [[z for z in range(3)] for x in range(NUM_ITEMS)],
3631 })
3632 t2 = pa.Table.from_pydict({
3633 'id': range(NUM_ITEMS),
3634 'value': [x for x in range(NUM_ITEMS)]
3635 })
3636
3637 # check as left table
3638 with pytest.raises(pa.lib.ArrowInvalid) as excinfo:
3639 t1.join(t2, 'id', join_type='inner')
3640 exp_error_msg = "Data type list<item: int64> is not supported " \
3641 + "in join non-key field array_column"
3642 assert exp_error_msg in str(excinfo.value)
3643
3644 # check as right table
3645 with pytest.raises(pa.lib.ArrowInvalid) as excinfo:
3646 t2.join(t1, 'id', join_type='inner')
3647 assert exp_error_msg in str(excinfo.value)
3648
3649
3650@pytest.fixture

Callers

nothing calls this directly

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected