Skip to content

Commit f38cd44

Browse files
authored
feat(pandas-gbq): drop support for Python 3.9 (#16476)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-cloud-python/issues) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes internal b/490130968 🦕
1 parent 961eacd commit f38cd44

File tree

8 files changed

+46
-38
lines changed

8 files changed

+46
-38
lines changed

packages/pandas-gbq/noxfile.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@
3434

3535
DEFAULT_PYTHON_VERSION = "3.14"
3636

37-
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
37+
UNIT_TEST_PYTHON_VERSIONS = [
38+
"3.10",
39+
"3.11",
40+
"3.12",
41+
"3.13",
42+
"3.14",
43+
# Not supported, but included so that we can explicitly skip the session
44+
# from here. Keep unsupported versions last so that they don't conflict with
45+
# the prerelease_deps session.
46+
"3.9",
47+
]
3848

3949
UNIT_TEST_STANDARD_DEPENDENCIES = [
4050
"mock",
@@ -54,7 +64,7 @@
5464
"geopandas",
5565
]
5666
UNIT_TEST_EXTRAS_BY_PYTHON = {
57-
"3.9": [],
67+
"3.10": [],
5868
}
5969

6070
SYSTEM_TEST_PYTHON_VERSIONS = ["3.12"]
@@ -225,6 +235,8 @@ def default(session):
225235
@_calculate_duration
226236
def unit(session):
227237
"""Run the unit test suite."""
238+
if session.python == "3.9":
239+
session.skip("Python 3.9 is not supported.")
228240
default(session)
229241

230242

packages/pandas-gbq/pandas_gbq/core/biglake.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import pandas_gbq.core.resource_references
2020

21-
2221
_DRY_RUN_TEMPLATE = """
2322
SELECT *
2423
FROM `{project}.{catalog}.{namespace}.{table}`

packages/pandas-gbq/pandas_gbq/core/resource_references.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import re
99
from typing import Union
1010

11-
1211
_TABLE_REFEREENCE_PATTERN = re.compile(
1312
# In the past, organizations could prefix their project IDs with a domain
1413
# name. Such projects still exist, especially at Google.

packages/pandas-gbq/pandas_gbq/core/sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
import psutil
1414

1515
import pandas_gbq.constants
16-
import pandas_gbq.core.read
1716
import pandas_gbq.core.biglake
18-
import pandas_gbq.gbq_connector
17+
import pandas_gbq.core.read
1918
import pandas_gbq.core.resource_references
19+
import pandas_gbq.gbq_connector
2020

2121
# Only import at module-level at type checking time to avoid circular
2222
# dependencies in the pandas package, which has an optional dependency on

packages/pandas-gbq/setup.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
release_status = "Development Status :: 4 - Beta"
2323
dependencies = [
2424
"setuptools",
25-
"db-dtypes >=1.0.4,<2.0.0",
26-
"numpy >=1.18.1",
27-
"pandas >=1.1.4",
28-
"pyarrow >= 4.0.0",
25+
"db-dtypes >=1.1.1,<2.0.0",
26+
"numpy >=1.26.4",
27+
"pandas >=1.5.3",
28+
"pyarrow >= 12.0.0",
2929
# See https://arrow.apache.org/release/22.0.0.html
3030
"pyarrow >= 22.0.0; python_version >= '3.14'",
3131
"pydata-google-auth >=1.5.0",
@@ -46,7 +46,7 @@
4646
"google-cloud-bigquery-storage >=2.16.2, <3.0.0",
4747
],
4848
"tqdm": ["tqdm>=4.23.0"],
49-
"geopandas": ["geopandas>=0.9.0", "Shapely>=1.8.4"],
49+
"geopandas": ["geopandas>=0.14.4", "Shapely>=1.8.5"],
5050
}
5151

5252
# Setup boilerplate below this line.
@@ -88,7 +88,6 @@
8888
"License :: OSI Approved :: BSD License",
8989
"Programming Language :: Python",
9090
"Programming Language :: Python :: 3",
91-
"Programming Language :: Python :: 3.9",
9291
"Programming Language :: Python :: 3.10",
9392
"Programming Language :: Python :: 3.11",
9493
"Programming Language :: Python :: 3.12",
@@ -102,7 +101,7 @@
102101
packages=packages,
103102
install_requires=dependencies,
104103
extras_require=extras,
105-
python_requires=">=3.9",
104+
python_requires=">=3.10",
106105
include_package_data=True,
107106
zip_safe=False,
108107
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This constraints file is used to check that lower bounds
2+
# are correct in setup.py
3+
# List *all* library dependencies and extras in this file.
4+
# Pin the version to the lower bound.
5+
#
6+
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
7+
# Then this file should have foo==1.14.0
8+
db-dtypes==1.1.1
9+
numpy==1.26.4
10+
pandas==1.5.3
11+
psutil==5.9.8
12+
pyarrow==12.0.0
13+
pydata-google-auth==1.5.0
14+
google-api-core==2.15.0
15+
google-auth==2.14.1
16+
google-auth-oauthlib==0.7.0
17+
google-cloud-bigquery==3.20.0
18+
packaging==22.0.0
19+
# Extras
20+
google-cloud-bigquery-storage==2.16.2
21+
tqdm==4.23.0
22+
geopandas==0.14.4
23+
Shapely==1.8.5

packages/pandas-gbq/testing/constraints-3.9.txt

Lines changed: 0 additions & 23 deletions
This file was deleted.

packages/pandas-gbq/tests/unit/core/test_biglake.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
import google.cloud.bigquery
99

10-
from pandas_gbq.core import biglake
11-
from pandas_gbq.core import resource_references
10+
from pandas_gbq.core import biglake, resource_references
1211

1312

1413
def test_get_table_metadata(mock_bigquery_client):

0 commit comments

Comments
 (0)