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

Function test_table_factory_function_args_pandas

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

Source from the content-addressed store, hash-verified

2620
2621@pytest.mark.pandas
2622def test_table_factory_function_args_pandas():
2623 import pandas as pd
2624
2625 # from_pandas not accepting names or metadata:
2626 with pytest.raises(ValueError):
2627 pa.table(pd.DataFrame({'a': [1, 2, 3]}), names=['a'])
2628
2629 with pytest.raises(ValueError):
2630 pa.table(pd.DataFrame({'a': [1, 2, 3]}), metadata={b'foo': b'bar'})
2631
2632 # backwards compatibility for schema as first positional argument
2633 schema = pa.schema([('a', pa.int32())])
2634 table = pa.table(pd.DataFrame({'a': [1, 2, 3]}), schema)
2635 assert table.column('a').type == pa.int32()
2636
2637
2638def test_factory_functions_invalid_input():

Callers

nothing calls this directly

Calls 2

schemaMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected