Skip to content

Commit a9b1755

Browse files
1 parent 9b53801 commit a9b1755

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

‎pandas_gbq/gbq.py‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,9 +1097,7 @@ def to_gbq(
10971097
# fail early if there are bigframes-y methods available.
10981098
# https://github.com/googleapis/python-bigquery-pandas/issues/824
10991099
if hasattr(dataframe, "to_pandas") and hasattr(dataframe, "to_gbq"):
1100-
raise TypeError(
1101-
f"Expected a pandas.DataFrame, but got {repr(type(dataframe))}"
1102-
)
1100+
raise TypeError(f"Expected a pandas.DataFrame, but got {repr(type(dataframe))}")
11031101

11041102
_test_google_api_imports()
11051103

‎tests/unit/test_to_gbq.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class FakeDataFrame:
1616

1717
def to_gbq(self):
1818
"""Fake to_gbq() to mimic a bigframes object."""
19-
19+
2020
def to_pandas(self):
2121
"""Fake to_pandas() to mimic a bigframes object."""
2222

@@ -80,8 +80,7 @@ def test_to_gbq_with_bigframes_raises_typeerror():
8080
dataframe = FakeDataFrame()
8181

8282
with pytest.raises(
83-
TypeError,
84-
match=r"Expected a pandas.DataFrame, but got .+FakeDataFrame"
83+
TypeError, match=r"Expected a pandas.DataFrame, but got .+FakeDataFrame"
8584
):
8685
gbq.to_gbq(dataframe, "my_dataset.my_table", project_id="myproj")
8786

0 commit comments

Comments
 (0)