diff --git a/tests/unit/test_table.py b/tests/unit/test_table.py index 22c7c048d..9bdd7b596 100644 --- a/tests/unit/test_table.py +++ b/tests/unit/test_table.py @@ -3486,7 +3486,11 @@ def test_to_dataframe_w_dtypes_mapper(self): create_bqstorage_client=False, bool_dtype=pandas.BooleanDtype(), int_dtype=pandas.Int32Dtype(), - float_dtype=pandas.StringDtype(), + float_dtype=( + pandas.Float64Dtype() + if hasattr(pandas, "Float64Dtype") + else pandas.StringDtype() + ), string_dtype=pandas.StringDtype(), ) @@ -3494,7 +3498,10 @@ def test_to_dataframe_w_dtypes_mapper(self): self.assertEqual(df.complete.dtype.name, "boolean") self.assertEqual(df.age.dtype.name, "Int32") self.assertEqual(df.seconds.dtype.name, "Int32") - self.assertEqual(df.miles.dtype.name, "string") + self.assertEqual( + df.miles.dtype.name, + "Float64" if hasattr(pandas, "Float64Dtype") else "string", + ) self.assertEqual(df.name.dtype.name, "string") @unittest.skipIf(pandas is None, "Requires `pandas`")