diff --git a/jobs/webcompat-kb/pyproject.toml b/jobs/webcompat-kb/pyproject.toml index e8d6e59a..0178e11f 100644 --- a/jobs/webcompat-kb/pyproject.toml +++ b/jobs/webcompat-kb/pyproject.toml @@ -20,31 +20,31 @@ classifiers = [ license = "MPL-2.0" dependencies = [ "bugdantic==0.2.6", - "google-cloud-bigquery==3.34.0", + "google-cloud-bigquery==3.41.0", "httpx[http2]>=0.28.1", "jinja2>=3.1.6", - "pydantic==2.12.5", + "pydantic==2.13.4", "tomli-w>=1.2.0", "web-features==3.0.0", ] [project.optional-dependencies] test = [ - "mypy==1.16.0", - "ty==0.0.15", - "pandas-stubs==2.2.2.240603", - "pytest-ruff==0.4.1", - "pytest==8.4.0", - "ruff==0.11.13", - "types-cachetools==6.0.0.20250525", - "types-cffi==1.17.0.20250523", - "types-protobuf==6.30.2.20250516", + "mypy==2.1.0", + "ty==0.0.37", + "pandas-stubs==3.0.0.260204", + "pytest-ruff==0.5", + "pytest==9.0.3", + "ruff==0.15.13", + "types-cachetools==7.0.0.20260518", + "types-cffi==2.0.0.20260518", + "types-protobuf==7.34.1.20260518", "types-pyOpenSSL==24.1.0.20240722", - "types-python-dateutil==2.9.0.20250516", - "types-pytz==2025.2.0.20250516", - "types-requests==2.32.0.20250602", - "types-setuptools==80.9.0.20250529", - "types-tqdm==4.67.0.20250516", + "types-python-dateutil==2.9.0.20260518", + "types-pytz==2026.2.0.20260518", + "types-requests==2.33.0.20260518", + "types-setuptools==82.0.0.20260518", + "types-tqdm==4.67.3.20260518", ] [project.scripts] diff --git a/jobs/webcompat-kb/webcompat_kb/projectdata.py b/jobs/webcompat-kb/webcompat_kb/projectdata.py index 46ea0d21..572b72b4 100644 --- a/jobs/webcompat-kb/webcompat_kb/projectdata.py +++ b/jobs/webcompat-kb/webcompat_kb/projectdata.py @@ -460,11 +460,12 @@ def __init__( """Convert table schema metadata and template into a TableSchema""" self.schema_id_mapper = schema_id_mapper self.jinja_env = jinja2.Environment() - self.jinja_env.globals = { + template_globals: dict[str, Any] = { "metrics": {item.name: item for item in project_data.metric_dfns}, "metric_types": project_data.metric_types, "ranks": project_data.rank_dfns, } + self.jinja_env.globals = template_globals def create_table_schema( self, dataset_id: DatasetId, template: SchemaTemplate diff --git a/jobs/webcompat-kb/webcompat_kb/update_schema.py b/jobs/webcompat-kb/webcompat_kb/update_schema.py index 1b1fb37e..61fd4d9a 100644 --- a/jobs/webcompat-kb/webcompat_kb/update_schema.py +++ b/jobs/webcompat-kb/webcompat_kb/update_schema.py @@ -6,7 +6,7 @@ import os from dataclasses import dataclass, field from datetime import datetime -from typing import Callable, Iterable, Mapping, Optional, Sequence +from typing import Any, Callable, Iterable, Mapping, Optional, Sequence import jinja2 from google.cloud import bigquery @@ -70,12 +70,13 @@ def __init__( } self.jinja_env = jinja2.Environment() - self.jinja_env.globals = { + template_globals: dict[str, Any] = { "project": self.project.id, "metrics": {item.name: item for item in project.data.metric_dfns}, "metric_types": project.data.metric_types, "ranks": project.data.rank_dfns, } + self.jinja_env.globals = template_globals def create( self, only_schema_ids: Optional[set[SchemaId]] = None