Skip to content

Commit 4029d97

Browse files
committed
[TST] Add test for BigQuery dialect change warning
1 parent 13d004a commit 4029d97

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/io/test_gbq.py

+13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
import platform
55
import os
66

7+
try:
8+
from unittest import mock
9+
except ImportError:
10+
mock = pytest.importorskip("mock")
11+
712
import numpy as np
813
import pandas as pd
914
from pandas import compat, DataFrame
@@ -93,6 +98,14 @@ def make_mixed_dataframe_v2(test_size):
9398
index=range(test_size))
9499

95100

101+
def test_read_gbq_without_dialect_warns_future_change(monkeypatch):
102+
mock_read_gbq = mock.Mock()
103+
mock_read_gbq.return_value = DataFrame([[1.0]])
104+
monkeypatch.setattr(pandas_gbq, 'read_gbq', mock_read_gbq)
105+
with pytest.warns(FutureWarning):
106+
pd.read_gbq("SELECT 1")
107+
108+
96109
@pytest.mark.single
97110
class TestToGBQIntegrationWithServiceAccountKeyPath(object):
98111

0 commit comments

Comments
 (0)