From 0dfccb88805dc272fe6637dde845ce7452a3deab Mon Sep 17 00:00:00 2001 From: Blake Rosenthal Date: Thu, 5 Sep 2024 09:22:18 -0700 Subject: [PATCH] don't use mutable param --- ragna/deploy/_api/schemas.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ragna/deploy/_api/schemas.py b/ragna/deploy/_api/schemas.py index 0cd308a4..bce4ad5d 100644 --- a/ragna/deploy/_api/schemas.py +++ b/ragna/deploy/_api/schemas.py @@ -2,7 +2,7 @@ import uuid from datetime import datetime, timezone -from typing import Annotated, Any, Union +from typing import Annotated, Any, Optional, Union from pydantic import AfterValidator, BaseModel, Field @@ -36,7 +36,10 @@ def from_core(cls, document: ragna.core.Document) -> Document: name=document.name, ) - def to_core(self, metadata={}) -> ragna.core.Document: + def to_core(self, metadata: Optional[dict[str, Any]] = None) -> ragna.core.Document: + if metadata is None: + metadata = {} + return ragna.core.LocalDocument( id=self.id, name=self.name,