fix: tolerate absent annotations when digesting schema index artifacts
This commit is contained in:
@@ -14,7 +14,12 @@ vector_app = typer.Typer(help="Indice semantico Qdrant (derivato, rigenerabile)"
|
||||
|
||||
|
||||
def _artifact_digest(path: Path) -> str:
|
||||
return "sha256:" + hashlib.sha256(path.read_bytes()).hexdigest()
|
||||
try:
|
||||
contents = path.read_bytes()
|
||||
except FileNotFoundError:
|
||||
# An absent annotations file is valid (empty curation); digest the empty artifact.
|
||||
contents = b""
|
||||
return "sha256:" + hashlib.sha256(contents).hexdigest()
|
||||
|
||||
|
||||
def _emit_json(payload: dict) -> None:
|
||||
|
||||
Reference in New Issue
Block a user