You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

erdantic

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

erdantic - pypi Package Compare versions

Comparing version
1.0.2
to
1.0.3
+5
-1
erdantic/core.py

@@ -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"

# 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

@@ -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"

@@ -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."""