mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-07 23:13:05 +00:00
fix(ingest): support multiple entity_registry sections (#7066)
This commit is contained in:
parent
a3f4c40422
commit
f39ed5244c
@ -272,7 +272,13 @@ def generate(entity_registry: str, schemas_path: str, outdir: str) -> None:
|
||||
aspect = aspects[entity.keyAspect]
|
||||
|
||||
# This requires that entities cannot share a keyAspect.
|
||||
assert "keyForEntity" not in aspect["Aspect"]
|
||||
if (
|
||||
"keyForEntity" in aspect["Aspect"]
|
||||
and aspect["Aspect"]["keyForEntity"] != entity.name
|
||||
):
|
||||
raise ValueError(
|
||||
f'Entity key {entity.keyAspect} is used by {aspect["Aspect"]["keyForEntity"]} and {entity.name}'
|
||||
)
|
||||
|
||||
aspect["Aspect"]["keyForEntity"] = entity.name
|
||||
aspect["Aspect"]["entityCategory"] = entity.category
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user