Skip to content

Commit cfca407

Browse files
authored
Fix type so that subclasses are dumped with all their fields (was causing issues in logging with prettify function that calls model_dump where all fields were removed because not in DataModel) (#346)
1 parent b96a9bd commit cfca407

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/neo4j_graphrag/experimental/pipeline/types/orchestration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import enum
1919
from typing import Optional
2020

21-
from pydantic import BaseModel, Field
21+
from pydantic import BaseModel, Field, SerializeAsAny
2222

2323
from neo4j_graphrag.experimental.pipeline.component import DataModel
2424

@@ -40,7 +40,7 @@ def possible_next_status(self) -> list[RunStatus]:
4040

4141
class RunResult(BaseModel):
4242
status: RunStatus = RunStatus.DONE
43-
result: Optional[DataModel] = None
43+
result: Optional[SerializeAsAny[DataModel]] = None
4444
timestamp: datetime.datetime = Field(
4545
default_factory=lambda: datetime.datetime.now(datetime.timezone.utc)
4646
)

0 commit comments

Comments
 (0)