Skip to content

Commit

Permalink
Specify asyncpg.pgproto.pgproto.UUID fully.
Browse files Browse the repository at this point in the history
In previous change, UUID probably referred to uuid.UUID
  • Loading branch information
danscales committed May 20, 2024
1 parent 926801e commit 2d0a21d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/responses.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import decimal
import io
from typing import Any
import asyncpg

import orjson
from fastapi.responses import Response, StreamingResponse
Expand Down Expand Up @@ -74,7 +75,7 @@ def jsonencoder_lite(obj):
encoding large lists. This encoder only encodes the bare necessities
needed to work with serializers like ORJSON.
"""
if isinstance(obj, decimal.Decimal) or isinstance(obj, UUID):
if isinstance(obj, decimal.Decimal) or isinstance(obj, asyncpg.pgproto.pgproto.UUID):
return str(obj)
raise TypeError(
f"Unknown type for value {obj} with class type {type(obj).__name__}"
Expand Down

0 comments on commit 2d0a21d

Please sign in to comment.