diff --git a/tests/system/test_pandas.py b/tests/system/test_pandas.py index 78ca3e438..2955d08d8 100644 --- a/tests/system/test_pandas.py +++ b/tests/system/test_pandas.py @@ -312,10 +312,6 @@ def test_load_table_from_dataframe_w_automatic_schema(bigquery_client, dataset_i ] -@pytest.mark.skipif( - PANDAS_INSTALLED_VERSION[0:2] in ["0."], - reason="Only `pandas version >=1.0.0` is supported", -) def test_load_table_from_dataframe_w_nullable_int64_datatype( bigquery_client, dataset_id ): @@ -343,10 +339,6 @@ def test_load_table_from_dataframe_w_nullable_int64_datatype( assert table.num_rows == 4 -@pytest.mark.skipif( - PANDAS_INSTALLED_VERSION[0:2] in ["0."], - reason="Only `pandas version >=1.0.0` is supported", -) def test_load_table_from_dataframe_w_nullable_int64_datatype_automatic_schema( bigquery_client, dataset_id, table_id ): diff --git a/tests/unit/test__pandas_helpers.py b/tests/unit/test__pandas_helpers.py index 74a839347..ad40a6da6 100644 --- a/tests/unit/test__pandas_helpers.py +++ b/tests/unit/test__pandas_helpers.py @@ -61,8 +61,6 @@ bigquery_storage = _versions_helpers.BQ_STORAGE_VERSIONS.try_import() -PANDAS_MINIUM_VERSION = "1.0.0" - if pandas is not None: PANDAS_INSTALLED_VERSION = metadata.version("pandas") else: @@ -807,10 +805,7 @@ def test_list_columns_and_indexes_with_named_index_same_as_column_name( assert columns_and_indexes == expected -@pytest.mark.skipif( - PANDAS_INSTALLED_VERSION[0:2] in ["0."], - reason="Only `pandas version >=1.0.0` is supported", -) +@pytest.mark.skipif(pandas is None, reason="Requires `pandas`") def test_dataframe_to_json_generator(module_under_test): utcnow = datetime.datetime.utcnow() df_data = collections.OrderedDict( @@ -838,16 +833,8 @@ def test_dataframe_to_json_generator(module_under_test): assert list(rows) == expected +@pytest.mark.skipif(pandas is None, reason="Requires `pandas`") def test_dataframe_to_json_generator_repeated_field(module_under_test): - pytest.importorskip( - "pandas", - minversion=str(PANDAS_MINIUM_VERSION), - reason=( - f"Requires `pandas version >= {PANDAS_MINIUM_VERSION}` " - "which introduces pandas.NA" - ), - ) - df_data = [ collections.OrderedDict( [("repeated_col", [pandas.NA, 2, None, 4]), ("not_repeated_col", "first")] diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 9787f95e5..7812fb26b 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -80,11 +80,6 @@ from test_utils.imports import maybe_fail_import from tests.unit.helpers import make_connection -if pandas is not None: - PANDAS_INSTALLED_VERSION = metadata.version("pandas") -else: - PANDAS_INSTALLED_VERSION = "0.0.0" - def _make_credentials(): import google.auth.credentials @@ -8146,11 +8141,8 @@ def test_load_table_from_dataframe_unknown_table(self): timeout=DEFAULT_TIMEOUT, ) - @unittest.skipIf( - PANDAS_INSTALLED_VERSION[0:2] in ["0."], - reason="Only `pandas version >=1.0.0` is supported", - ) @unittest.skipIf(pyarrow is None, "Requires `pyarrow`") + @unittest.skipIf(pandas is None, "Requires `pandas`") def test_load_table_from_dataframe_w_nullable_int64_datatype(self): from google.cloud.bigquery.client import _DEFAULT_NUM_RETRIES from google.cloud.bigquery import job @@ -8194,11 +8186,8 @@ def test_load_table_from_dataframe_w_nullable_int64_datatype(self): SchemaField("x", "INT64", "NULLABLE", None), ) - @unittest.skipIf( - PANDAS_INSTALLED_VERSION[0:2] in ["0."], - reason="Only `pandas version >=1.0.0` is supported", - ) # @unittest.skipIf(pyarrow is None, "Requires `pyarrow`") + @unittest.skipIf(pandas is None, "Requires `pandas`") def test_load_table_from_dataframe_w_nullable_int64_datatype_automatic_schema(self): from google.cloud.bigquery.client import _DEFAULT_NUM_RETRIES from google.cloud.bigquery import job