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:2683–2696  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2681
2682@pytest.mark.pandas
2683def test_table_factory_function_args_pandas():
2684 import pandas as pd
2685
2686 # from_pandas not accepting names or metadata:
2687 with pytest.raises(ValueError):
2688 pa.table(pd.DataFrame({'a': [1, 2, 3]}), names=['a'])
2689
2690 with pytest.raises(ValueError):
2691 pa.table(pd.DataFrame({'a': [1, 2, 3]}), metadata={b'foo': b'bar'})
2692
2693 # backwards compatibility for schema as first positional argument
2694 schema = pa.schema([('a', pa.int32())])
2695 table = pa.table(pd.DataFrame({'a': [1, 2, 3]}), schema)
2696 assert table.column('a').type == pa.int32()
2697
2698
2699def test_factory_functions_invalid_input():

Callers

nothing calls this directly

Calls 2

schemaMethod · 0.45
columnMethod · 0.45

Tested by

no test coverage detected