Skip to content

Commit 3b725b3

Browse files
authored
Python: fix(core): define EdgeGroup's builtins.type alias at module scope (#9614)
The `from builtins import type as builtin_type` import lived inside the EdgeGroup class body, making `EdgeGroup.builtin_type` a class member aliasing builtins.type. The Public API Compatibility workflow (griffe) raises `AliasResolutionError: Could not resolve alias agent_framework._workflows._edge.EdgeGroup.builtin_type pointing at builtins.type` while loading the API, which fails the check on every PR. Move the alias to module scope (matching _request_info_mixin.py, which already does this) so the spurious class member is gone while the annotations (builtin_type[...]) stay resolvable. No runtime or type-checker behavior change: the module uses `from __future__ import annotations`, and builtin_type is referenced only in annotations. Verified griffe loads EdgeGroup cleanly; pyright and ruff pass.
1 parent a8e284c commit 3b725b3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • python/packages/core/agent_framework/_workflows

‎python/packages/core/agent_framework/_workflows/_edge.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import inspect
66
import logging
77
import uuid
8+
from builtins import type as builtin_type
89
from collections.abc import Awaitable, Callable, Sequence
910
from dataclasses import dataclass, field
1011
from typing import Any, ClassVar, TypeAlias, TypeVar
@@ -312,8 +313,6 @@ class EdgeGroup(DictConvertible):
312313
type: str
313314
edges: list[Edge]
314315

315-
from builtins import type as builtin_type
316-
317316
_TYPE_REGISTRY: ClassVar[dict[str, builtin_type[EdgeGroup]]] = {}
318317

319318
def __init__(

0 commit comments

Comments
 (0)