erdantic
Advanced tools
+4
-0
@@ -515,2 +515,6 @@ from enum import Enum | ||
| return False | ||
| # ellipsis object (used for example in tuple[int, ...]) don't have __module__ attribute | ||
| # This is also not going to be a model | ||
| elif "__module__" in str(e): | ||
| return False | ||
| raise | ||
@@ -517,0 +521,0 @@ if key not in self.models: |
+4
-0
| # erdantic Changelog | ||
| ## v1.0.5 (2024-09-19) | ||
| - Fixed runtime `AttributeError` that occurred when creating a diagram that includes a model with a field that uses a type annotation with the ellipsis literal (e.g., `tuple[int, ...]`). ([Issue #124](https://github.com/drivendataorg/erdantic/issues/124), [PR #127](https://github.com/drivendataorg/erdantic/pull/127)) | ||
| ## v1.0.4 (2024-07-16) | ||
@@ -4,0 +8,0 @@ |
+1
-1
| Metadata-Version: 2.3 | ||
| Name: erdantic | ||
| Version: 1.0.4 | ||
| Version: 1.0.5 | ||
| Summary: Entity relationship diagrams for Python data model classes like Pydantic. | ||
@@ -5,0 +5,0 @@ Project-URL: Repository, https://github.com/drivendataorg/erdantic |
+1
-1
@@ -7,3 +7,3 @@ [build-system] | ||
| name = "erdantic" | ||
| version = "1.0.4" | ||
| version = "1.0.5" | ||
| description = "Entity relationship diagrams for Python data model classes like Pydantic." | ||
@@ -10,0 +10,0 @@ readme = "README.md" |
+13
-1
@@ -7,3 +7,3 @@ import builtins | ||
| import sys | ||
| from typing import Any, AnyStr, List, Literal, Optional, TypeVar | ||
| from typing import Any, AnyStr, List, Literal, Optional, Tuple, TypeVar | ||
@@ -204,4 +204,16 @@ if sys.version_info >= (3, 9): | ||
| diagram.add_model(MyModel) | ||
| diagram.to_dot() | ||
| def test_model_with_ellipsis(): | ||
| """Model with Ellipsis should not error.""" | ||
| class EllipsisModel(pydantic.BaseModel): | ||
| ellipsis_field: Tuple[int, ...] | ||
| diagram = EntityRelationshipDiagram() | ||
| diagram.add_model(EllipsisModel) | ||
| diagram.to_dot() | ||
| def test_model_with_no_fields(): | ||
@@ -208,0 +220,0 @@ """Model with no fields should not error.""" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
1702104
0.04%4817
0.25%