Skip to content

Commit b9f746a

Browse files
fix(python): correct PermissionHandler.approve_all type annotations (github#618)
The approve_all static method used untyped parameters (Any) and returned a plain dict, conflicting with the _PermissionHandlerFn signature that expects (PermissionRequest, dict[str, str]) -> PermissionRequestResult. - Replace parameter types: Any → PermissionRequest, dict[str, str] - Replace return type: dict → PermissionRequestResult - Use PermissionRequestResult() constructor instead of dict literal Fixes github#612 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent bb02de1 commit b9f746a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/copilot/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,10 @@ class PermissionRequestResult(TypedDict, total=False):
192192

193193
class PermissionHandler:
194194
@staticmethod
195-
def approve_all(request: Any, invocation: Any) -> dict:
196-
return {"kind": "approved"}
195+
def approve_all(
196+
request: PermissionRequest, invocation: dict[str, str]
197+
) -> PermissionRequestResult:
198+
return PermissionRequestResult(kind="approved")
197199

198200

199201
# ============================================================================

0 commit comments

Comments
 (0)