GeezerVison is showing github.com — chore: update tests to be compatible with pandas 2.0 (#1538) · simonmoya/python-bigquery@67698f7
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: tests/unit/test_table.py +9-2Lines changed: 9 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3486,15 +3486,22 @@ def test_to_dataframe_w_dtypes_mapper(self): |
3486 | 3486 | create_bqstorage_client=False, |
3487 | 3487 | bool_dtype=pandas.BooleanDtype(), |
3488 | 3488 | int_dtype=pandas.Int32Dtype(), |
3489 | | - float_dtype=pandas.StringDtype(), |
| 3489 | + float_dtype=( |
| 3490 | + pandas.Float64Dtype() |
| 3491 | + if hasattr(pandas, "Float64Dtype") |
| 3492 | + else pandas.StringDtype() |
| 3493 | + ), |
3490 | 3494 | string_dtype=pandas.StringDtype(), |
3491 | 3495 | ) |
3492 | 3496 |
|
3493 | 3497 | self.assertIsInstance(df, pandas.DataFrame) |
3494 | 3498 | self.assertEqual(df.complete.dtype.name, "boolean") |
3495 | 3499 | self.assertEqual(df.age.dtype.name, "Int32") |
3496 | 3500 | self.assertEqual(df.seconds.dtype.name, "Int32") |
3497 | | - self.assertEqual(df.miles.dtype.name, "string") |
| 3501 | + self.assertEqual( |
| 3502 | + df.miles.dtype.name, |
| 3503 | + "Float64" if hasattr(pandas, "Float64Dtype") else "string", |
| 3504 | + ) |
3498 | 3505 | self.assertEqual(df.name.dtype.name, "string") |
3499 | 3506 |
|
3500 | 3507 | @unittest.skipIf(pandas is None, "Requires `pandas`") |
|