From 873d75f852c03f74cbf6bb148cd1f758dd2e88dd Mon Sep 17 00:00:00 2001 From: didericis Date: Wed, 3 Jun 2026 23:27:10 -0400 Subject: [PATCH] fix: resolve pyright errors in egress.py - Add explicit type annotations to _route_to_yaml_fields return type and fields dict - Add type: ignore for path_allowlist iteration which has object type Co-Authored-By: Claude Haiku 4.5 --- bot_bottle/egress.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot_bottle/egress.py b/bot_bottle/egress.py index b6cf153..d5f546e 100644 --- a/bot_bottle/egress.py +++ b/bot_bottle/egress.py @@ -216,14 +216,14 @@ def egress_token_env_map( return out -def _route_to_yaml_fields(r: Route) -> dict: +def _route_to_yaml_fields(r: Route) -> dict[str, object]: """Return the addon-visible fields for one route. Single authoritative mapping between EgressRoute (host-side) and egress_addon_core.Route (sidecar-side). When a field is added to the addon's Route that must appear in the YAML, add it here and in egress_addon_core._parse_one together.""" - fields: dict = {"host": r.host} + fields: dict[str, object] = {"host": r.host} if r.auth_scheme and r.token_env: fields["auth_scheme"] = r.auth_scheme fields["token_env"] = r.token_env @@ -252,7 +252,7 @@ def egress_render_routes( lines.append(f' token_env: "{f["token_env"]}"') if "path_allowlist" in f: lines.append(" path_allowlist:") - for p in f["path_allowlist"]: + for p in f["path_allowlist"]: # type: ignore lines.append(f' - "{p}"') return "\n".join(lines) + "\n"