diff --git a/pandas_gbq/gbq.py b/pandas_gbq/gbq.py index 003a5844..feffd858 100644 --- a/pandas_gbq/gbq.py +++ b/pandas_gbq/gbq.py @@ -1097,9 +1097,7 @@ def to_gbq( # fail early if there are bigframes-y methods available. # https://github.com/googleapis/python-bigquery-pandas/issues/824 if hasattr(dataframe, "to_pandas") and hasattr(dataframe, "to_gbq"): - raise TypeError( - f"Expected a pandas.DataFrame, but got {repr(type(dataframe))}" - ) + raise TypeError(f"Expected a pandas.DataFrame, but got {repr(type(dataframe))}") _test_google_api_imports() diff --git a/tests/unit/test_to_gbq.py b/tests/unit/test_to_gbq.py index f8a04db4..f4012dc8 100644 --- a/tests/unit/test_to_gbq.py +++ b/tests/unit/test_to_gbq.py @@ -16,7 +16,7 @@ class FakeDataFrame: def to_gbq(self): """Fake to_gbq() to mimic a bigframes object.""" - + def to_pandas(self): """Fake to_pandas() to mimic a bigframes object.""" @@ -80,8 +80,7 @@ def test_to_gbq_with_bigframes_raises_typeerror(): dataframe = FakeDataFrame() with pytest.raises( - TypeError, - match=r"Expected a pandas.DataFrame, but got .+FakeDataFrame" + TypeError, match=r"Expected a pandas.DataFrame, but got .+FakeDataFrame" ): gbq.to_gbq(dataframe, "my_dataset.my_table", project_id="myproj")