Skip to content

Commit

Permalink
Fix #99 for sqlalchemy 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
acarapetis committed Nov 29, 2023
1 parent 925cac5 commit a6f8cce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sqlakeyset/sqla14.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Methods for messing with the internals of SQLAlchemy >1.3 results."""
from __future__ import annotations
from sqlalchemy.engine.result import SimpleResultMetaData
from sqlalchemy.engine.row import LegacyRow

from .constants import ORDER_COL_PREFIX
Expand Down Expand Up @@ -37,8 +38,12 @@ def core_coerce_row(row, extra_columns, result_type):
else:
cls = TruncatedRow

parent = row._parent
if isinstance(parent, SimpleResultMetaData):
parent = parent._reduce(list(parent.keys)[:N])

return cls(
row._parent,
parent,
None, # Processors are applied immediately in sqla1.4+
{ # Strip out added OCs from the keymap:
k: v
Expand Down

0 comments on commit a6f8cce

Please sign in to comment.