Skip to content

Commit b3faa0b

Browse files
chore: adds Python 3.7/3.8 EOL pending deprecation warning (#817)
* chore: adds deprecation warnings related to Python 3.7 3.8 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update pandas_gbq/__init__.py --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 107bb40 commit b3faa0b

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

noxfile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def default(session):
208208
session.run(
209209
"py.test",
210210
"--quiet",
211+
"-W default::PendingDeprecationWarning",
211212
f"--junitxml=unit_{session.python}_sponge_log.xml",
212213
"--cov=pandas_gbq",
213214
"--cov=tests/unit",
@@ -290,6 +291,7 @@ def system(session):
290291
session.run(
291292
"py.test",
292293
"--quiet",
294+
"-W default::PendingDeprecationWarning",
293295
f"--junitxml=system_{session.python}_sponge_log.xml",
294296
system_test_path,
295297
*session.posargs,
@@ -298,6 +300,7 @@ def system(session):
298300
session.run(
299301
"py.test",
300302
"--quiet",
303+
"-W default::PendingDeprecationWarning",
301304
f"--junitxml=system_{session.python}_sponge_log.xml",
302305
system_test_folder_path,
303306
*session.posargs,
@@ -372,6 +375,7 @@ def prerelease(session):
372375
session.run(
373376
"py.test",
374377
"--quiet",
378+
"-W default::PendingDeprecationWarning",
375379
f"--junitxml=prerelease_unit_{session.python}_sponge_log.xml",
376380
os.path.join("tests", "unit"),
377381
*session.posargs,
@@ -380,6 +384,7 @@ def prerelease(session):
380384
session.run(
381385
"py.test",
382386
"--quiet",
387+
"-W default::PendingDeprecationWarning",
383388
f"--junitxml=prerelease_system_{session.python}_sponge_log.xml",
384389
os.path.join("tests", "system"),
385390
*session.posargs,

pandas_gbq/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,24 @@
22
# Use of this source code is governed by a BSD-style
33
# license that can be found in the LICENSE file.
44

5+
import warnings
6+
57
from pandas_gbq import version as pandas_gbq_version
68

9+
from . import _versions_helpers
710
from .gbq import Context, context, read_gbq, to_gbq # noqa
811

12+
sys_major, sys_minor, sys_micro = _versions_helpers.extract_runtime_version()
13+
if sys_major == 3 and sys_minor in (7, 8):
14+
warnings.warn(
15+
"The python-bigquery library will stop supporting Python 3.7 "
16+
"and Python 3.8 in a future major release expected in Q4 2024. "
17+
f"Your Python version is {sys_major}.{sys_minor}.{sys_micro}. We "
18+
"recommend that you update soon to ensure ongoing support. For "
19+
"more details, see: [Google Cloud Client Libraries Supported Python Versions policy](https://cloud.google.com/python/docs/supported-python-versions)",
20+
PendingDeprecationWarning,
21+
)
22+
923
__version__ = pandas_gbq_version.__version__
1024

1125
__all__ = [

pandas_gbq/_versions_helpers.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2024 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Shared helper functions for verifying versions of installed modules."""
16+
17+
18+
import sys
19+
from typing import Tuple
20+
21+
22+
def extract_runtime_version() -> Tuple[int, int, int]:
23+
# Retrieve the version information
24+
version_info = sys.version_info
25+
26+
# Extract the major, minor, and micro components
27+
major = version_info.major
28+
minor = version_info.minor
29+
micro = version_info.micro
30+
31+
# Display the version number in a clear format
32+
return major, minor, micro

0 commit comments

Comments
 (0)