Skip to content

Commit 9331a7e

Browse files
committed
remove unnecessary version checks
1 parent 893704a commit 9331a7e

File tree

3 files changed

+4
-36
lines changed

3 files changed

+4
-36
lines changed

tests/system/test_pandas.py

-8
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@ def test_load_table_from_dataframe_w_automatic_schema(bigquery_client, dataset_i
312312
]
313313

314314

315-
@pytest.mark.skipif(
316-
PANDAS_INSTALLED_VERSION[0:2] in ["0."],
317-
reason="Only `pandas version >=1.0.0` is supported",
318-
)
319315
def test_load_table_from_dataframe_w_nullable_int64_datatype(
320316
bigquery_client, dataset_id
321317
):
@@ -343,10 +339,6 @@ def test_load_table_from_dataframe_w_nullable_int64_datatype(
343339
assert table.num_rows == 4
344340

345341

346-
@pytest.mark.skipif(
347-
PANDAS_INSTALLED_VERSION[0:2] in ["0."],
348-
reason="Only `pandas version >=1.0.0` is supported",
349-
)
350342
def test_load_table_from_dataframe_w_nullable_int64_datatype_automatic_schema(
351343
bigquery_client, dataset_id, table_id
352344
):

tests/unit/test__pandas_helpers.py

+2-15
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@
6161

6262
bigquery_storage = _versions_helpers.BQ_STORAGE_VERSIONS.try_import()
6363

64-
PANDAS_MINIUM_VERSION = "1.0.0"
65-
6664
if pandas is not None:
6765
PANDAS_INSTALLED_VERSION = metadata.version("pandas")
6866
else:
@@ -807,10 +805,7 @@ def test_list_columns_and_indexes_with_named_index_same_as_column_name(
807805
assert columns_and_indexes == expected
808806

809807

810-
@pytest.mark.skipif(
811-
PANDAS_INSTALLED_VERSION[0:2] in ["0."],
812-
reason="Only `pandas version >=1.0.0` is supported",
813-
)
808+
@pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
814809
def test_dataframe_to_json_generator(module_under_test):
815810
utcnow = datetime.datetime.utcnow()
816811
df_data = collections.OrderedDict(
@@ -838,16 +833,8 @@ def test_dataframe_to_json_generator(module_under_test):
838833
assert list(rows) == expected
839834

840835

836+
@pytest.mark.skipif(pandas is None, reason="Requires `pandas`")
841837
def test_dataframe_to_json_generator_repeated_field(module_under_test):
842-
pytest.importorskip(
843-
"pandas",
844-
minversion=str(PANDAS_MINIUM_VERSION),
845-
reason=(
846-
f"Requires `pandas version >= {PANDAS_MINIUM_VERSION}` "
847-
"which introduces pandas.NA"
848-
),
849-
)
850-
851838
df_data = [
852839
collections.OrderedDict(
853840
[("repeated_col", [pandas.NA, 2, None, 4]), ("not_repeated_col", "first")]

tests/unit/test_client.py

+2-13
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@
8080
from test_utils.imports import maybe_fail_import
8181
from tests.unit.helpers import make_connection
8282

83-
if pandas is not None:
84-
PANDAS_INSTALLED_VERSION = metadata.version("pandas")
85-
else:
86-
PANDAS_INSTALLED_VERSION = "0.0.0"
87-
8883

8984
def _make_credentials():
9085
import google.auth.credentials
@@ -8146,11 +8141,8 @@ def test_load_table_from_dataframe_unknown_table(self):
81468141
timeout=DEFAULT_TIMEOUT,
81478142
)
81488143

8149-
@unittest.skipIf(
8150-
PANDAS_INSTALLED_VERSION[0:2] in ["0."],
8151-
reason="Only `pandas version >=1.0.0` is supported",
8152-
)
81538144
@unittest.skipIf(pyarrow is None, "Requires `pyarrow`")
8145+
@unittest.skipIf(pandas is None, "Requires `pandas`")
81548146
def test_load_table_from_dataframe_w_nullable_int64_datatype(self):
81558147
from google.cloud.bigquery.client import _DEFAULT_NUM_RETRIES
81568148
from google.cloud.bigquery import job
@@ -8194,11 +8186,8 @@ def test_load_table_from_dataframe_w_nullable_int64_datatype(self):
81948186
SchemaField("x", "INT64", "NULLABLE", None),
81958187
)
81968188

8197-
@unittest.skipIf(
8198-
PANDAS_INSTALLED_VERSION[0:2] in ["0."],
8199-
reason="Only `pandas version >=1.0.0` is supported",
8200-
)
82018189
# @unittest.skipIf(pyarrow is None, "Requires `pyarrow`")
8190+
@unittest.skipIf(pandas is None, "Requires `pandas`")
82028191
def test_load_table_from_dataframe_w_nullable_int64_datatype_automatic_schema(self):
82038192
from google.cloud.bigquery.client import _DEFAULT_NUM_RETRIES
82048193
from google.cloud.bigquery import job

0 commit comments

Comments
 (0)