You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this great project. It is really helpful and simplifies the migration from django to fastapi.
I use SQLAlchemyPanel and have a mysql table with a binary column described by:
filedata: Mapped[bytes] =mapped_column(LONGBLOB)
When updating this column with binary data, I receive the following error
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9d in position 15: invalid start byte
Traceback is
File "[..].venv/lib/python3.11/site-packages/debug_toolbar/panels/sqlalchemy.py", line 44, in after_execute
self.add_query(str(context.engine.url), query)
File "[..].venv/lib/python3.11/site-packages/debug_toolbar/panels/sql.py", line 110, in add_query
self._queries.append((alias, jsonable_encoder(query)))
^^^^^^^^^^^^^^^^^^^^^^^
File "[..].venv/lib/python3.11/site-packages/fastapi/encoders.py", line 289, in jsonable_encoder
encoded_value = jsonable_encoder(
^^^^^^^^^^^^^^^^^
File "[..].venv/lib/python3.11/site-packages/fastapi/encoders.py", line 303, in jsonable_encoder
jsonable_encoder(
File "[..].venv/lib/python3.11/site-packages/fastapi/encoders.py", line 289, in jsonable_encoder
encoded_value = jsonable_encoder(
^^^^^^^^^^^^^^^^^
File "[..].venv/lib/python3.11/site-packages/fastapi/encoders.py", line 318, in jsonable_encoder
return ENCODERS_BY_TYPE[type(obj)](obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[..].venv/lib/python3.11/site-packages/fastapi/encoders.py", line 59, in <lambda>
bytes: lambda o: o.decode(),
^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9d in position 15: invalid start byte
I am facing a similar problem with this one, except in my case it's a JSONB column.
File "/venv/lib/python3.12/site-packages/debug_toolbar/panels/sqlalchemy.py", line 44, in after_execute
self.add_query(str(context.engine.url), query)
File "/venv/lib/python3.12/site-packages/debug_toolbar/panels/sql.py", line 110, in add_query
self._queries.append((alias, jsonable_encoder(query)))
^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/fastapi/encoders.py", line 289, in jsonable_encoder
encoded_value = jsonable_encoder(
^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/fastapi/encoders.py", line 303, in jsonable_encoder
jsonable_encoder(
File "/venv/lib/python3.12/site-packages/fastapi/encoders.py", line 289, in jsonable_encoder
encoded_value = jsonable_encoder(
^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.12/site-packages/fastapi/encoders.py", line 332, in jsonable_encoder
raise ValueError(errors) from e
ValueError: [TypeError("'Jsonb' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]
Thanks for this great project. It is really helpful and simplifies the migration from django to fastapi.
I use SQLAlchemyPanel and have a mysql table with a binary column described by:
When updating this column with binary data, I receive the following error
Traceback is
A simplified example for a fastapi endpoint is
It seems that the bytes parameter cannot be logged.
Used versions:
The text was updated successfully, but these errors were encountered: