Skip to content

Commit c0a9c88

Browse files
committed
Fix all the tests
1 parent 56effc6 commit c0a9c88

File tree

10 files changed

+1120
-1108
lines changed

10 files changed

+1120
-1108
lines changed

src/backend/fastapi_app/api_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class ItemPublic(BaseModel):
4545
id: str
4646
name: str
4747
cuisine: str
48-
rating: int
48+
rating: float
4949
price_level: int
5050
review_count: int
5151
description: str

src/backend/fastapi_app/postgres_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Item(Base):
1515
id: Mapped[str] = mapped_column(primary_key=True)
1616
name: Mapped[str] = mapped_column()
1717
cuisine: Mapped[str] = mapped_column()
18-
rating: Mapped[int] = mapped_column()
18+
rating: Mapped[float] = mapped_column()
1919
price_level: Mapped[int] = mapped_column()
2020
review_count: Mapped[int] = mapped_column()
2121
description: Mapped[str] = mapped_column()

src/backend/fastapi_app/routes/api_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def format_as_ndjson(r: AsyncGenerator[RetrievalResponseDelta, None]) -> A
4545

4646

4747
@router.get("/items/{id}", response_model=ItemPublic)
48-
async def item_handler(database_session: DBSession, id: int) -> ItemPublic:
48+
async def item_handler(database_session: DBSession, id: str) -> ItemPublic:
4949
"""A simple API to get an item by ID."""
5050
item = (await database_session.scalars(select(Item).where(Item.id == id))).first()
5151
if not item:
@@ -55,7 +55,7 @@ async def item_handler(database_session: DBSession, id: int) -> ItemPublic:
5555

5656
@router.get("/similar", response_model=list[ItemWithDistance])
5757
async def similar_handler(
58-
context: CommonDeps, database_session: DBSession, id: int, n: int = 5
58+
context: CommonDeps, database_session: DBSession, id: str, n: int = 5
5959
) -> list[ItemWithDistance]:
6060
"""A similarity API to find items similar to items with given ID."""
6161
item = (await database_session.scalars(select(Item).where(Item.id == id))).first()

0 commit comments

Comments
 (0)