Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypy errors #131

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion erdantic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from typing_extensions import Self

import pydantic
import pygraphviz as pgv # type: ignore [import-not-found]
import pygraphviz as pgv # type: ignore [import-untyped, import-not-found]
from sortedcontainers_pydantic import SortedDict
from typenames import REMOVE_ALL_MODULES, typenames

Expand Down
4 changes: 2 additions & 2 deletions erdantic/plugins/dataclasses.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataclasses
import re
import sys
from typing import TYPE_CHECKING, Any, List, Type, get_type_hints
from typing import TYPE_CHECKING, Any, List, Type, cast, get_type_hints

if sys.version_info >= (3, 9):
# include_extras was added in Python 3.9
Expand Down Expand Up @@ -69,7 +69,7 @@ def get_fields_from_dataclass(model: DataclassType) -> List[FieldInfo]:
FieldInfo.from_raw_type(
model_full_name=FullyQualifiedName.from_object(model),
name=f.name,
raw_type=f.type,
raw_type=cast(type, f.type), # cast narrows type for typechecking
)
for f in dataclasses.fields(model)
]
Expand Down
Loading