Skip to content
Open
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
10 changes: 3 additions & 7 deletions src/prime_rl/utils/monitor/wandb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from transformers.tokenization_utils import PreTrainedTokenizer
from wandb.errors import CommError
from wandb.sdk.mailbox.mailbox_handle import ServerResponseError
from wandb_gql import gql

from prime_rl.configs.shared import WandbConfig, WandbWithExtrasConfig
from prime_rl.utils.config import BaseConfig
from prime_rl.utils.logger import get_logger
Expand Down Expand Up @@ -381,16 +379,14 @@ def build_sections(train_envs: Sequence[str] = (), eval_envs: Sequence[str] = ()

def list_views(entity: str, project: str) -> list[tuple[str, str]]:
"""``(display_name, internal_name)`` for every saved view in the project."""
query = gql(
"""
query = """
query Views($entity: String!, $project: String!) {
project(name: $project, entityName: $entity) {
allViews(viewType: "project-view") { edges { node { name displayName } } }
}
}
"""
)
res = wandb.Api().client.execute(query, variable_values={"entity": entity, "project": project})
"""
res = wandb.Api()._service_api.execute_graphql(query, {"entity": entity, "project": project})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Incompatible wandb GraphQL API call

Medium Severity

list_views now calls wandb.Api()._service_api.execute_graphql, which only exists after the wandb-core GraphQL routing change in wandb 0.27.1. The project still allows wandb>=0.26.1 and locks 0.27.0, so overview-view lookup can fail with AttributeError on supported installs. Failures are caught as warnings, so training continues but curated overview reuse/creation silently stops working.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3f4f653. Configure here.

edges = ((res.get("project") or {}).get("allViews") or {}).get("edges") or []
return [(e["node"]["displayName"], e["node"]["name"]) for e in edges if e.get("node")]

Expand Down