fastapi-pagination icon indicating copy to clipboard operation
fastapi-pagination copied to clipboard

Paginate throws not implemented exception

Open jarzuaga-va opened this issue 1 year ago • 2 comments

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

jarzuaga-va avatar Oct 08 '24 14:10 jarzuaga-va

Hi @jarzuaga-va,

New version 0.12.31 has been released, this issue should be fixed.

uriyyo avatar Oct 08 '24 17:10 uriyyo

@jarzuaga-va Sorry for bothering you, any updates?

uriyyo avatar Oct 10 '24 11:10 uriyyo