Daniel Reichenpfader
03/11/2025, 10:02 AMbento build (running bentoml serve works like a charm). Bentoml version 1.4.3
I get an RecursionError originating from __flatten_field_() in /_bentoml_sdk/method.py
UPDATE: I was able to track it down to one of my pydantic definitions, and now I assume that the Concept->Relation->Concept causes the recursion.
SOLVED: I replaced the circular reference to Concept in Relation with string fields.
class Coding(BaseModel):
code: str
system: str
class Concept(BaseModel):
text: str
text_span_normalized: Optional[str] = None
categories: List[str]
codes: List[Coding]
relations: "Optional[List[Relation]]" = None
class Relation(BaseModel):
name: str
target: Concept
Can you confirm that the error is related to the pydantic type definition? If yes, any idea how to solve it?