| 2681 | |
| 2682 | @pytest.mark.pandas |
| 2683 | def 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 | |
| 2699 | def test_factory_functions_invalid_input(): |