Skip to content

Commit 3b64ccc

Browse files
committed
Fix lint and test
1 parent dd74d10 commit 3b64ccc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/graphql/pyutils/path.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
from __future__ import annotations
44

5-
from typing import Any, NamedTuple, Optional
5+
from typing import NamedTuple
66

77
__all__ = ["Path"]
88

99

1010
class Path(NamedTuple):
1111
"""A generic path of string or integer indices"""
1212

13-
prev: Optional[Path]
13+
prev: Path | None
1414
"""path with the previous indices"""
1515
key: str | int
1616
"""current index in the path (string or integer)"""
@@ -25,7 +25,7 @@ def as_list(self) -> list[str | int]:
2525
"""Return a list of the path keys."""
2626
flattened: list[str | int] = []
2727
append = flattened.append
28-
curr: Path = self
28+
curr: Path | None = self
2929
while curr:
3030
append(curr.key)
3131
curr = curr.prev

src/graphql/validation/rules/overlapping_fields_can_be_merged.py

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
from typing_extensions import TypeAlias
3939

4040

41-
MYPY = False
42-
4341
__all__ = ["OverlappingFieldsCanBeMergedRule"]
4442

4543

tests/execution/test_executor.py

+2
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,11 @@ def resolve_type(_val, _info, _type):
308308
prev, key, typename = path
309309
assert key == "l2"
310310
assert typename == "SomeObject"
311+
assert prev is not None
311312
prev, key, typename = prev
312313
assert key == 0
313314
assert typename is None
315+
assert prev is not None
314316
prev, key, typename = prev
315317
assert key == "l1"
316318
assert typename == "SomeQuery"

0 commit comments

Comments
 (0)