Skip to content

Commit a76f7f3

Browse files
committed
Fix the tests
1 parent 2a505b1 commit a76f7f3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

python/pyarrow/table.pxi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5048,6 +5048,7 @@ def concat_tables(tables, MemoryPool memory_pool=None, str promote_options="none
50485048
For memory allocations, if required, otherwise use default pool.
50495049
promote_options : str, default none
50505050
Accepts strings "none", "default" and "permissive".
5051+
**kwargs: dict
50515052
50525053
Examples
50535054
--------
@@ -5091,7 +5092,7 @@ def concat_tables(tables, MemoryPool memory_pool=None, str promote_options="none
50915092
elif promote_options in {"default", "none"}:
50925093
options.field_merge_options = CField.CMergeOptions.Defaults()
50935094
else:
5094-
raise ValueError(f"Invalid mode: {promote_options}")
5095+
raise ValueError(f"Invalid promote options: {promote_options}")
50955096

50965097
with nogil:
50975098
options.unify_schemas = promote_options != "none"

python/pyarrow/tests/test_table.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,14 +1334,16 @@ def test_concat_tables_permissive():
13341334
t1 = pa.Table.from_arrays([list(range(10))], names=('a',))
13351335
t2 = pa.Table.from_arrays([list(('a', 'b', 'c'))], names=('a',))
13361336

1337-
with pytest.raises(pa.ArrowInvalid, match="Schema at index 1 was different:"):
1337+
with pytest.raises(
1338+
pa.ArrowTypeError,
1339+
match="Unable to merge: Field a has incompatible types: int64 vs string"):
13381340
_ = pa.concat_tables([t1, t2], promote_options="permissive")
13391341

13401342

13411343
def test_concat_tables_invalid_option():
13421344
t = pa.Table.from_arrays([list(range(10))], names=('a',))
13431345

1344-
with pytest.raises(ValueError, match="Invalid merge option: invalid"):
1346+
with pytest.raises(ValueError, match="Invalid promote options: invalid"):
13451347
pa.concat_tables([t, t], promote_options="invalid")
13461348

13471349

0 commit comments

Comments
 (0)