| 627 | assert pandas_metadata['columns'][0]['pandas_type'] == 'object' |
| 628 | |
| 629 | def test_decimal_metadata(self): |
| 630 | expected = pd.DataFrame({ |
| 631 | 'decimals': [ |
| 632 | decimal.Decimal('394092382910493.12341234678'), |
| 633 | -decimal.Decimal('314292388910493.12343437128'), |
| 634 | ] |
| 635 | }) |
| 636 | table = pa.Table.from_pandas(expected) |
| 637 | js = table.schema.pandas_metadata |
| 638 | assert 'mixed' not in js |
| 639 | data_column = js['columns'][0] |
| 640 | assert data_column['pandas_type'] == 'decimal' |
| 641 | assert data_column['numpy_type'] == 'object' |
| 642 | assert data_column['metadata'] == {'precision': 26, 'scale': 11} |
| 643 | |
| 644 | @pytest.mark.parametrize('typ', [ |
| 645 | pa.decimal32, |