erdantic
Advanced tools
+5
-1
@@ -302,3 +302,7 @@ from enum import Enum | ||
| # Get number of columns dynamically from first row | ||
| num_cols = next(iter(self.fields.values())).to_dot_row().count("<td") | ||
| try: | ||
| num_cols = next(iter(self.fields.values())).to_dot_row().count("<td") | ||
| except StopIteration: | ||
| # No fields, so just use 1 column | ||
| num_cols = 1 | ||
| # Concatenate DOT of all rows together | ||
@@ -305,0 +309,0 @@ rows = "\n".join(field_info.to_dot_row() for field_info in self.fields.values()) + "\n" |
+4
-0
| # erdantic Changelog | ||
| ## v1.0.3 (2024-05-10) | ||
| - Fixed `StopIteration` error when rendering a model that has no fields. ([Issue #120](https://github.com/drivendataorg/erdantic/issues/120), [PR #121](https://github.com/drivendataorg/erdantic/pull/121)) | ||
| ## v1.0.2 (2024-04-11) | ||
@@ -4,0 +8,0 @@ |
+1
-1
| Metadata-Version: 2.3 | ||
| Name: erdantic | ||
| Version: 1.0.2 | ||
| Version: 1.0.3 | ||
| 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.2" | ||
| version = "1.0.3" | ||
| description = "Entity relationship diagrams for Python data model classes like Pydantic." | ||
@@ -10,0 +10,0 @@ readme = "README.md" |
+11
-0
@@ -191,2 +191,13 @@ import builtins | ||
| def test_model_with_no_fields(): | ||
| """Model with no fields should not error.""" | ||
| class EmptyModel(pydantic.BaseModel): | ||
| pass | ||
| diagram = EntityRelationshipDiagram() | ||
| diagram.add_model(EmptyModel) | ||
| diagram.to_dot() | ||
| def test_unsupported_forward_ref_resolution(monkeypatch): | ||
@@ -193,0 +204,0 @@ """Plugin implementation does not do anything to resolve forward references.""" |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
1701093
0.03%4803
0.23%