Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion python/pyarrow/table.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,8 @@ def table(data, names=None, schema=None, metadata=None):
"passing a pandas DataFrame")
return Table.from_pandas(data, schema=schema)
else:
return TypeError("Expected pandas DataFrame or python dictionary")
raise TypeError(
"Expected pandas DataFrame, python dictionary or list of arrays")


def concat_tables(tables):
Expand Down
5 changes: 5 additions & 0 deletions python/pyarrow/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,11 @@ def test_table_factory_function_args_pandas():
assert table.column('a').type == pa.int32()


def test_table_factory_function_invalid_input():
with pytest.raises(TypeError, match="Expected pandas DataFrame, python"):
pa.table("invalid input")


def test_table_function_unicode_schema():
col_a = "äääh"
col_b = "öööf"
Expand Down