Skip to content

deps!: Remove support for Python 3.8 #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ branchProtectionRules:
- 'OwlBot Post Processor'
- 'docs'
- 'lint'
- 'unit (3.8)'
- 'unit (3.9)'
- 'unit (3.10)'
- 'unit (3.11)'
Expand All @@ -20,7 +19,6 @@ branchProtectionRules:
- 'cover'
- 'Kokoro'
- 'Samples - Lint'
- 'Samples - Python 3.8'
- 'Samples - Python 3.9'
- 'Samples - Python 3.10'
- 'Samples - Python 3.11'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# Only run the following session(s)
env_vars: {
key: "NOX_SESSION"
value: "system-3.8"
}
value: "system-3.9"
}
8 changes: 3 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

- The feature must work fully on the following CPython versions:
3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.
3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows.

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
Expand Down Expand Up @@ -148,7 +148,7 @@ Running System Tests

.. note::

System tests are only configured to run under Python 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13.
System tests are only configured to run under Python 3.9, 3.10, 3.11, 3.12 and 3.13.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down Expand Up @@ -221,14 +221,12 @@ Supported Python Versions

We support:

- `Python 3.8`_
- `Python 3.9`_
- `Python 3.10`_
- `Python 3.11`_
- `Python 3.12`_
- `Python 3.13`_

.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
.. _Python 3.11: https://docs.python.org/3.11/
Expand All @@ -241,7 +239,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
.. _config: https://github.com/googleapis/python-bigquery-pandas/blob/main/noxfile.py


We also explicitly decided to support Python 3 beginning with version 3.8.
We also explicitly decided to support Python 3 beginning with version 3.9.
Reasons for this include:

- Encouraging use of newest versions of Python 3
Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
DEFAULT_PYTHON_VERSION = "3.10"


UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
"asyncmock",
Expand All @@ -57,7 +57,7 @@
"3.9": [],
}

SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
Expand Down
7 changes: 4 additions & 3 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
extras = ["tqdm", "geopandas"]
templated_files = common.py_library(
default_python_version="3.10",
unit_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
system_test_python_versions=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
unit_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13"],
system_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13"],
cov_level=96,
unit_test_external_dependencies=["freezegun"],
unit_test_extras=extras,
Expand All @@ -57,8 +57,9 @@
"docs/multiprocessing.rst",
"noxfile.py",
"README.rst",
# exclude this file as we have an alternate prerelease.cfg
".github/workflows/docs.yml",
".github/sync-repo-settings.yaml",
# exclude this file as we have an alternate prerelease.cfg
".kokoro/presubmit/prerelease-deps.cfg",
".kokoro/presubmit/presubmit.cfg",
],
Expand Down
14 changes: 7 additions & 7 deletions pandas_gbq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
from .gbq import read_gbq, to_gbq # noqa

sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
if sys_major == 3 and sys_minor in (7, 8):
if sys_major == 3 and sys_minor < 9:
warnings.warn(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe raise an error instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the Python docs: FutureWarning: Base category for warnings about deprecated features when those warnings are intended for end users of applications that are written in Python.

I suspect for a small window of time this library will likely still run under 3.7 or 3.8. At some point we will introduce a 3.9+ only feature and then things will get hairy.

For now, the use of a FutureWarning (which end users will see under the default settings of the warnings module) seems like a slightly less jarring way to migrate end users toward running 3.9.

"The python-bigquery library will stop supporting Python 3.7 "
"and Python 3.8 in a future major release expected in Q4 2024. "
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
"recommend that you update soon to ensure ongoing support. For "
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
PendingDeprecationWarning,
"pandas-gbq no longer supports Python versions older than 3.9. "
"Your Python version is "
f"{sys_major}.{sys_minor}.{sys_micro}. Please update "
"to Python 3.9 or newer to ensure ongoing support. For more details, "
"see: https://cloud.google.com/python/docs/supported-python-versions",
FutureWarning,
)

__version__ = pandas_gbq_version.__version__
Expand Down
5 changes: 2 additions & 3 deletions samples/snippets/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
google-cloud-bigquery-storage==2.29.1
google-cloud-bigquery==3.30.0
pandas-gbq==0.28.0
pandas===2.0.3; python_version == '3.8'
pandas==2.2.3; python_version >= '3.9'
pyarrow==19.0.1; python_version >= '3.9'
pandas==2.2.3
pyarrow==19.0.1
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -99,7 +98,7 @@
packages=packages,
install_requires=dependencies,
extras_require=extras,
python_requires=">=3.8",
python_requires=">=3.9",
include_package_data=True,
zip_safe=False,
)
22 changes: 0 additions & 22 deletions testing/constraints-3.8.txt

This file was deleted.

20 changes: 20 additions & 0 deletions testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,22 @@
# This constraints file is used to check that lower bounds
# are correct in setup.py
# List *all* library dependencies and extras in this file.
# Pin the version to the lower bound.
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
db-dtypes==1.0.4
numpy==1.19.4
pandas==1.1.4
pyarrow==4.0.0
pydata-google-auth==1.5.0
google-api-core==2.10.2
google-auth==2.13.0
google-auth-oauthlib==0.7.0
google-cloud-bigquery==3.4.2
packaging==22.0.0
# Extras
google-cloud-bigquery-storage==2.16.2
tqdm==4.23.0
geopandas==0.9.0
Shapely==1.8.4