fastapi-pagination
fastapi-pagination copied to clipboard
Paginate throws not implemented exception
After upgrading from 0.12.27 to the latest version (0.12.29, also a problem in 0.12.30), paginate is throwing a not implemented error
File "/home/appuser/.local/lib/python3.12/site-packages/fastapi_pagination/ext/sqlalchemy.py", line 350, in paginate
return exec_pagination(
^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.12/site-packages/fastapi_pagination/ext/sqlalchemy.py", line 246, in exec_pagination
items = _unwrap_items(items, query, unwrap_mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.12/site-packages/fastapi_pagination/ext/sqlalchemy.py", line 183, in _unwrap_items
elif unwrap_mode == "auto" and _should_unwrap_scalars(query):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.12/site-packages/fastapi_pagination/ext/sqlalchemy.py", line 86, in _should_unwrap_scalars
return len(query.column_descriptions) == 1 and len(query._all_selected_columns) > 1
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.12/site-packages/sqlalchemy/util/langhelpers.py", line 1130, in __get__
return self.fget(obj)
^^^^^^^^^^^^^^
File "/home/appuser/.local/lib/python3.12/site-packages/sqlalchemy/sql/base.py", line 1070, in _all_selected_columns
raise NotImplementedError()
NotImplementedError
Hi @jarzuaga-va,
New version 0.12.31 has been released, this issue should be fixed.
@jarzuaga-va Sorry for bothering you, any updates?