From ae2a07037a768693d4f05f343a592051b8872ce5 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Sat, 23 Mar 2019 13:36:28 -0700 Subject: [PATCH 1/3] TST: Use pandas.api.types functions for dtypes checks This should make checking for expected dtypes more robust. --- tests/system/test_gbq.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/system/test_gbq.py b/tests/system/test_gbq.py index a98b6794..a70f9669 100644 --- a/tests/system/test_gbq.py +++ b/tests/system/test_gbq.py @@ -7,6 +7,7 @@ import google.oauth2.service_account import numpy as np import pandas +import pandas.api.types import pandas.util.testing as tm from pandas import DataFrame, NaT, compat from pandas.compat import range, u @@ -364,16 +365,16 @@ def test_should_properly_handle_arbitrary_datetime(self, project_id): ) @pytest.mark.parametrize( - "expression, type_", + "expression, is_expected_dtype", [ - ("current_date()", " Date: Sat, 23 Mar 2019 13:41:57 -0700 Subject: [PATCH 2/3] Blacken --- tests/system/test_gbq.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/system/test_gbq.py b/tests/system/test_gbq.py index a70f9669..4480f203 100644 --- a/tests/system/test_gbq.py +++ b/tests/system/test_gbq.py @@ -374,7 +374,9 @@ def test_should_properly_handle_arbitrary_datetime(self, project_id): ("FALSE", pandas.api.types.is_bool_dtype), ], ) - def test_return_correct_types(self, project_id, expression, is_expected_dtype): + def test_return_correct_types( + self, project_id, expression, is_expected_dtype + ): """ All type checks can be added to this function using additional parameters, rather than creating additional functions. From 92f74bdb713113b0dba35c0c5fdda0b2a17ed42a Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Sat, 23 Mar 2019 15:07:49 -0700 Subject: [PATCH 3/3] Bump minimum pandas version for access to pandas.api.types module. --- ci/requirements-2.7.pip | 2 +- docs/source/changelog.rst | 3 ++- setup.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/requirements-2.7.pip b/ci/requirements-2.7.pip index 10300f12..46c79306 100644 --- a/ci/requirements-2.7.pip +++ b/ci/requirements-2.7.pip @@ -1,5 +1,5 @@ mock -pandas==0.17.1 +pandas==0.19.0 google-auth==1.4.1 google-auth-oauthlib==0.0.1 google-cloud-bigquery==1.9.0 diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 72330194..9e0fbd9d 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -13,6 +13,7 @@ Dependency updates - Update the minimum version of ``google-cloud-bigquery`` to 1.9.0. (:issue:`247`) +- Update the minimum version of ``pandas`` to 0.19.0. (:issue:`262`) Internal changes ~~~~~~~~~~~~~~~~ @@ -23,7 +24,7 @@ Internal changes Enhancements ~~~~~~~~~~~~ - Allow ``table_schema`` in :func:`to_gbq` to contain only a subset of columns, - with the rest being populated using the DataFrame dtypes (:issue:`218`) + with the rest being populated using the DataFrame dtypes (:issue:`218`) (contributed by @johnpaton) - Read ``project_id`` in :func:`to_gbq` from provided ``credentials`` if available (contributed by @daureg) diff --git a/setup.py b/setup.py index e5e40505..8e36e54a 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ def readme(): INSTALL_REQUIRES = [ "setuptools", - "pandas", + "pandas>=0.19.0", "pydata-google-auth", "google-auth", "google-auth-oauthlib",