From 1164c0f9e808728142d140cba089cf80b3337953 Mon Sep 17 00:00:00 2001 From: Semyon Moroz Date: Thu, 10 Jul 2025 11:26:23 +0000 Subject: [PATCH] [jmespath] Remove from pyrightconfig (#14378) --- pyrightconfig.stricter.json | 1 - stubs/jmespath/jmespath/ast.pyi | 2 +- stubs/jmespath/jmespath/exceptions.pyi | 2 +- stubs/jmespath/jmespath/visitor.pyi | 9 ++++++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 72cebd4b8..9acd48158 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -50,7 +50,6 @@ "stubs/httplib2", "stubs/hvac", "stubs/icalendar", - "stubs/jmespath", "stubs/jsonschema", "stubs/jwcrypto", "stubs/ldap3", diff --git a/stubs/jmespath/jmespath/ast.pyi b/stubs/jmespath/jmespath/ast.pyi index 76651892e..a9ee32a7c 100644 --- a/stubs/jmespath/jmespath/ast.pyi +++ b/stubs/jmespath/jmespath/ast.pyi @@ -52,4 +52,4 @@ def pipe(left: _ASTNode, right: _ASTNode) -> _ASTNode: ... def projection(left: _ASTNode, right: _ASTNode) -> _ASTNode: ... def subexpression(children: list[_ASTNode]) -> _ASTNode: ... def slice(start: _ASTNode, end: _ASTNode, step: _ASTNode) -> _ASTNode: ... -def value_projection(left, right) -> _ASTNode: ... +def value_projection(left: _ASTNode, right: _ASTNode) -> _ASTNode: ... diff --git a/stubs/jmespath/jmespath/exceptions.pyi b/stubs/jmespath/jmespath/exceptions.pyi index 13500a8e0..45a6c4ec5 100644 --- a/stubs/jmespath/jmespath/exceptions.pyi +++ b/stubs/jmespath/jmespath/exceptions.pyi @@ -30,7 +30,7 @@ class ArityError(ParseError): expected_arity: int actual_arity: int function_name: str - def __init__(self, expected, actual, name) -> None: ... + def __init__(self, expected: int, actual: int, name: str) -> None: ... class VariadictArityError(ArityError): ... diff --git a/stubs/jmespath/jmespath/visitor.pyi b/stubs/jmespath/jmespath/visitor.pyi index 64125ddd1..fb8c3f63d 100644 --- a/stubs/jmespath/jmespath/visitor.pyi +++ b/stubs/jmespath/jmespath/visitor.pyi @@ -17,11 +17,14 @@ class _Expression: expression: str interpreter: Visitor def __init__(self, expression: str, interpreter: Visitor) -> None: ... - def visit(self, node: _TreeNode, *args, **kwargs) -> Any: ... + # `args` and `kwargs` are passed to the appropriate `visit_*` method. + def visit(self, node: _TreeNode, *args: Any, **kwargs: Any) -> Any: ... class Visitor: def __init__(self) -> None: ... - def visit(self, node: _TreeNode, *args, **kwargs) -> Any: ... + # `args` and `kwargs` are passed to the appropriate `visit_*` method. + # Its return value is returned from visit. + def visit(self, node: _TreeNode, *args: Any, **kwargs: Any) -> Any: ... def default_visit(self, node: _TreeNode, *args: Unused, **kwargs: Unused) -> NoReturn: ... class _TreeNode(TypedDict): @@ -59,4 +62,4 @@ class TreeInterpreter(Visitor): class GraphvizVisitor(Visitor): def __init__(self) -> None: ... - def visit(self, node: _TreeNode, *args, **kwargs) -> str: ... + def visit(self, node: _TreeNode, *args: Unused, **kwargs: Unused) -> str: ...