Skip to content

Commit 7d2a7e0

Browse files
committed
🥅 (util) Ensure entity id
1 parent 9488f56 commit 7d2a7e0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

openaleph_procrastinate/util.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
77
log = get_logger(__name__)
88

99

10-
def make_stub_entity(
11-
e: E,
12-
entity_type: Type[E] | None = ValueEntity,
13-
) -> E | None:
10+
def make_stub_entity(e: E, entity_type: Type[E] | None = ValueEntity) -> E:
1411
"""
1512
Reduce an entity to its ID and schema
1613
"""
1714
if not e.id:
18-
log.warning("Entity has no ID!")
19-
return
15+
raise RuntimeError("Entity has no ID!")
2016
return make_entity(
2117
{"id": e.id, "schema": e.schema.name, "caption": e.caption}, entity_type
2218
)

0 commit comments

Comments
 (0)