Skip to content

Commit 5f18add

Browse files
authored
chore: reduce number of versions notebooks are tested on (#1353)
These tests frequently encounter quota issues. Reducing the number of versions we test with should help alleviate this. IMO, the most important versions to test with are the ones for Google's hosted notebook environments.
1 parent 012081a commit 5f18add

File tree

1 file changed

+28
-24
lines changed

1 file changed

+28
-24
lines changed

noxfile.py

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@
3434
# TODO: switch to 3.13 once remote functions / cloud run adds a runtime for it (internal issue 333742751)
3535
LATEST_FULLY_SUPPORTED_PYTHON = "3.12"
3636

37+
# Notebook tests should match colab and BQ Studio.
38+
# Check with import sys; sys.version_info
39+
# on a fresh notebook runtime.
40+
COLAB_AND_BQ_STUDIO_PYTHON_VERSIONS = [
41+
# BQ Studio
42+
"3.10",
43+
# colab.research.google.com
44+
"3.11",
45+
]
46+
3747
# pytest-retry is not yet compatible with pytest 8.x.
3848
# https://github.com/str0zzapreti/pytest-retry/issues/32
3949
PYTEST_VERSION = "pytest<8.0.0dev"
@@ -64,8 +74,9 @@
6474
UNIT_TEST_EXTRAS: List[str] = []
6575
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {"3.12": ["polars"]}
6676

67-
# There are 4 different ibis-framework 9.x versions we want to test against.
68-
# 3.10 is needed for Windows tests.
77+
# 3.10 is needed for Windows tests as it is the only version installed in the
78+
# bigframes-windows container image. For more information, search
79+
# bigframes/windows-docker, internally.
6980
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.12", "3.13"]
7081
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
7182
"jinja2",
@@ -698,7 +709,7 @@ def system_prerelease(session: nox.sessions.Session):
698709
)
699710

700711

701-
@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
712+
@nox.session(python=COLAB_AND_BQ_STUDIO_PYTHON_VERSIONS)
702713
def notebook(session: nox.Session):
703714
google_cloud_project = os.getenv("GOOGLE_CLOUD_PROJECT")
704715
if not google_cloud_project:
@@ -776,27 +787,20 @@ def notebook(session: nox.Session):
776787
notebooks = list(filter(lambda nb: nb not in denylist, notebooks))
777788

778789
# Regionalized notebooks
779-
# TODO: remove exception for Python 3.13 cloud run adds a runtime for it (internal issue 333742751)
780-
# TODO: remove exception for Python 3.13 if nbmake adds support for
781-
# sys.exit(0) or pytest.skip(...).
782-
# See: https://github.com/treebeardtech/nbmake/issues/134
783-
if session.python == "3.13":
784-
notebooks_reg = {}
785-
else:
786-
notebooks_reg = {
787-
"regionalized.ipynb": [
788-
"asia-southeast1",
789-
"eu",
790-
"europe-west4",
791-
"southamerica-west1",
792-
"us",
793-
"us-central1",
794-
]
795-
}
796-
notebooks_reg = {
797-
os.path.join("notebooks/location", nb): regions
798-
for nb, regions in notebooks_reg.items()
799-
}
790+
notebooks_reg = {
791+
"regionalized.ipynb": [
792+
"asia-southeast1",
793+
"eu",
794+
"europe-west4",
795+
"southamerica-west1",
796+
"us",
797+
"us-central1",
798+
]
799+
}
800+
notebooks_reg = {
801+
os.path.join("notebooks/location", nb): regions
802+
for nb, regions in notebooks_reg.items()
803+
}
800804

801805
# The pytest --nbmake exits silently with "no tests ran" message if
802806
# one of the notebook paths supplied does not exist. Let's make sure that

0 commit comments

Comments
 (0)