Skip to content

Commit

Permalink
[TST] Add test for BigQuery dialect change warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast committed Sep 11, 2018
1 parent 13d004a commit 4029d97
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pandas/tests/io/test_gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
import platform
import os

try:
from unittest import mock
except ImportError:
mock = pytest.importorskip("mock")

import numpy as np
import pandas as pd
from pandas import compat, DataFrame
Expand Down Expand Up @@ -93,6 +98,14 @@ def make_mixed_dataframe_v2(test_size):
index=range(test_size))


def test_read_gbq_without_dialect_warns_future_change(monkeypatch):
mock_read_gbq = mock.Mock()
mock_read_gbq.return_value = DataFrame([[1.0]])
monkeypatch.setattr(pandas_gbq, 'read_gbq', mock_read_gbq)
with pytest.warns(FutureWarning):
pd.read_gbq("SELECT 1")


@pytest.mark.single
class TestToGBQIntegrationWithServiceAccountKeyPath(object):

Expand Down

0 comments on commit 4029d97

Please sign in to comment.