Skip to content
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
32 changes: 16 additions & 16 deletions jobs/webcompat-kb/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion jobs/webcompat-kb/webcompat_kb/projectdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions jobs/webcompat-kb/webcompat_kb/update_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down