Skip to content

Commit

Permalink
Remove now unnecessary type casts
Browse files Browse the repository at this point in the history
  • Loading branch information
DoctorJohn committed Dec 24, 2024
1 parent 5f4491e commit 8f35ea7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions strawberry/utils/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def _get_namespace_from_ast(
and expr.value.id == "Union"
):
if hasattr(ast, "Index") and isinstance(expr.slice, ast.Index):
expr_slice = cast(Any, expr.slice).value
expr_slice = expr.slice.value

Check warning on line 260 in strawberry/utils/typing.py

View check run for this annotation

Codecov / codecov/patch

strawberry/utils/typing.py#L260

Added line #L260 was not covered by tests
else:
expr_slice = expr.slice

Expand All @@ -275,7 +275,7 @@ def _get_namespace_from_ast(
and expr.value.id == "Annotated"
):
if hasattr(ast, "Index") and isinstance(expr.slice, ast.Index):
expr_slice = cast(Any, expr.slice).value
expr_slice = expr.slice.value

Check warning on line 278 in strawberry/utils/typing.py

View check run for this annotation

Codecov / codecov/patch

strawberry/utils/typing.py#L278

Added line #L278 was not covered by tests
else:
expr_slice = expr.slice

Expand Down

0 comments on commit 8f35ea7

Please sign in to comment.