From 9cc380d027775b81d59229258a0199f5bbfd2654 Mon Sep 17 00:00:00 2001 From: Adam Azzam <33043305+aaazzam@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:33:02 -0600 Subject: [PATCH] Remove FastAPI from prefect.flow's default import path. (#16473) --- src/prefect/flows.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prefect/flows.py b/src/prefect/flows.py index 4ffef3c1dfc3..cbd763952c2f 100644 --- a/src/prefect/flows.py +++ b/src/prefect/flows.py @@ -37,7 +37,6 @@ from uuid import UUID import pydantic -from fastapi.encoders import jsonable_encoder from pydantic.v1 import BaseModel as V1BaseModel from pydantic.v1.decorator import ValidatedFunction as V1ValidatedFunction from pydantic.v1.errors import ConfigError # TODO @@ -613,6 +612,8 @@ def serialize_parameters(self, parameters: dict[str, Any]) -> dict[str, Any]: serialized_parameters[key] = f"<{type(value).__name__}>" continue try: + from fastapi.encoders import jsonable_encoder + serialized_parameters[key] = jsonable_encoder(value) except (TypeError, ValueError): logger.debug(