Skip to content

Commit

Permalink
don't use mutable param
Browse files Browse the repository at this point in the history
  • Loading branch information
blakerosenthal committed Sep 5, 2024
1 parent 81bdf33 commit 0dfccb8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ragna/deploy/_api/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0dfccb8

Please sign in to comment.