Skip to content

Commit 32d7b8f

Browse files
committed
Removes pandas older than 1.5 and misc changes
1 parent 7beea0d commit 32d7b8f

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

db_dtypes/__init__.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121
import warnings
2222

2323
import numpy
24-
import packaging.version
2524
import pandas
2625
import pandas.api.extensions
2726
from pandas.errors import OutOfBoundsDatetime
2827
import pyarrow
2928
import pyarrow.compute
3029

3130
from db_dtypes import core
31+
from db_dtypes.json import JSONArray, JSONArrowType, JSONDtype
3232
from db_dtypes.version import __version__
3333

3434
from . import _versions_helpers
@@ -46,7 +46,6 @@
4646
# nanosecond precision when boxing scalars.
4747
_NP_BOX_DTYPE = "datetime64[us]"
4848

49-
from db_dtypes.json import JSONArray, JSONArrowType, JSONDtype
5049

5150
@pandas.api.extensions.register_extension_dtype
5251
class TimeDtype(core.BaseDatetimeDtype):
@@ -342,15 +341,14 @@ def __sub__(self, other):
342341
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
343342
if sys_major == 3 and sys_minor in (7, 8):
344343
warnings.warn(
345-
"The python-bigquery library will stop supporting Python 3.7 "
346-
"and Python 3.8 in a future major release expected in Q4 2024. "
344+
"The python-bigquery library as well as the python-db-dtypes-pandas library no "
345+
"longer supports Python 3.7 and Python 3.8. "
347346
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
348347
"recommend that you update soon to ensure ongoing support. For "
349348
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
350-
PendingDeprecationWarning,
349+
FutureWarning,
351350
)
352351

353-
354352
if not JSONArray or not JSONDtype:
355353
__all__ = [
356354
"__version__",

db_dtypes/core.py

-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ def median(
186186
keepdims: bool = False,
187187
skipna: bool = True,
188188
):
189-
190189
pandas_backports.numpy_validate_median(
191190
(),
192191
{"out": out, "overwrite_input": overwrite_input, "keepdims": keepdims},
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
pytest===7.4.4; python_version == '3.7' # prevents dependabot from upgrading it
2-
pytest==8.3.3; python_version > '3.7'
1+
pytest==8.3.5

scripts/readme-gen/templates/install_deps.tmpl.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install Dependencies
1212
.. _Python Development Environment Setup Guide:
1313
https://cloud.google.com/python/setup
1414

15-
#. Create a virtualenv. Samples are compatible with Python 3.7+.
15+
#. Create a virtualenv. Samples are compatible with Python >= 3.9.
1616

1717
.. code-block:: bash
1818

tests/unit/test_dtypes.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import datetime
1616

17-
import packaging.version
1817
import pytest
1918

2019
pd = pytest.importorskip("pandas")
@@ -536,7 +535,7 @@ def test_min_max_median(dtype):
536535
a = cls(data)
537536
assert a.min() == sample_values[0]
538537
assert a.max() == sample_values[-1]
539-
538+
540539
assert (
541540
a.median() == datetime.time(1, 2, 4)
542541
if dtype == "dbtime"

0 commit comments

Comments
 (0)