Skip to content

feat(bigquery-magics): drop support for Python 3.9#16587

Open
tswast wants to merge 1 commit intomainfrom
tswast-magics
Open

feat(bigquery-magics): drop support for Python 3.9#16587
tswast wants to merge 1 commit intomainfrom
tswast-magics

Conversation

@tswast
Copy link
Copy Markdown
Contributor

@tswast tswast commented Apr 8, 2026

Related to b/490130968 and b/470438395
🦕

@tswast tswast requested review from a team as code owners April 8, 2026 20:48
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the package dependencies and drops support for Python 3.9, raising the minimum requirement to Python 3.10. Review feedback highlights that bigframes and geopandas were inadvertently removed from the test sessions and constraints, and questions the addition of pyopenssl as a mandatory dependency. Additionally, it is suggested to remove Python 3.9 entirely from the configuration lists rather than keeping it for explicit skipping, and to ensure that breaking changes regarding environment support are accompanied by appropriate versioning.

Comment on lines 66 to 68
"3.10": [
"bqstorage",
"bigframes",
"geopandas",
],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The dependencies bigframes and geopandas were removed from the Python 3.10 test session. Since 3.10 is now the minimum supported version, these extras should continue to be tested to ensure compatibility. If they were moved elsewhere, please clarify; otherwise, they should be restored to maintain test coverage.

    "3.10": [
        "bqstorage",
        "bigframes",
        "geopandas",
    ],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is intentional. We need a minimimal set of extras so that the minimum versions of dependencies can be properly tested.

Comment on lines 38 to 47
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
# Not supported, but included so that we can explicitly skip the session
# from here. Keep unsupported versions last so that they don't conflict with
# the prerelease_deps session.
"3.9",
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Instead of keeping Python 3.9 in the list and manually skipping it in every session, it is cleaner to remove it from UNIT_TEST_PYTHON_VERSIONS entirely. Note that dropping support for Python 3.9 is a breaking change; per repository rules, this should be handled with a minor version bump rather than a patch to allow for continued support of the previous environment. Additionally, Python 3.14 should be included in the versions list as it is a valid version for this repository.

    "3.10",
    "3.11",
    "3.12",
    "3.13",
    "3.14",
]
References
  1. When a release introduces breaking changes in environment requirements, such as dropping support for specific Python versions, prefer a minor version bump over a patch version bump.
  2. Python 3.14 is a valid Python version and should be supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can't do until the global github actions config is updated.

Comment on lines +227 to +228
if session.python == "3.9":
session.skip("Python 3.9 is not supported.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This skip block is unnecessary if Python 3.9 is removed from the UNIT_TEST_PYTHON_VERSIONS list.

Comment on lines +284 to +285
if session.python == "3.9":
session.skip("Python 3.9 is not supported.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This skip block is unnecessary if Python 3.9 is removed from the UNIT_TEST_PYTHON_VERSIONS list.

"pyarrow >= 12.0.0",
"pydata-google-auth >=1.5.0",
"tqdm >= 4.7.4, <5.0.0",
"pyopenssl >= 23.3.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Adding pyopenssl as a mandatory dependency is a significant change, as it requires C extensions and is generally not needed for Python 3.10+. Could you explain why this is now required for all users? If it's only needed for specific edge cases, consider making it an optional extra.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Several unit tests fail without this change. Note that it is a required dependency in later versions of google-auth, anyway.

Comment on lines +1 to +21
# 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.1.1
geopandas==1.0.1
google-cloud-bigquery==3.13.0
google-cloud-bigquery-storage==2.6.0
ipywidgets==7.7.1
ipython==7.23.1
ipykernel==5.5.6
numpy==1.26.4
packaging==20.0.0
pandas==1.5.3
pyarrow==12.0.0
pydata-google-auth==1.5.0
pyopenssl==23.3.0
tqdm==4.7.4
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

bigframes was removed from the constraints file. If it remains a supported extra for this package, it should be included here at its minimum supported version to ensure that lower-bound compatibility is verified in CI.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

bigframes requires a newer version of the client library than I would like to upgrade to at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant