Skip to content

Commit dd5e981

Browse files
authored
Fix json encoding for models (#828)
1 parent 51ae985 commit dd5e981

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

web/server/watcher.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
import logging
44

5+
from fastapi.encoders import jsonable_encoder
56
from watchfiles import DefaultFilter, awatch
67

78
from sqlmesh.core import constants as c
@@ -28,7 +29,5 @@ async def watch_project(queue: asyncio.Queue) -> None:
2829
logger.exception("Error loading context")
2930
else:
3031
queue.put_nowait(
31-
Event(
32-
event="models", data=json.dumps([model.dict() for model in get_models(context)])
33-
)
32+
Event(event="models", data=json.dumps(jsonable_encoder(get_models(context))))
3433
)

0 commit comments

Comments
 (0)