Skip to content

Commit

Permalink
Update types.py
Browse files Browse the repository at this point in the history
  • Loading branch information
trisongz committed Mar 6, 2024
1 parent 7ee6341 commit ae7eb3f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lazyops/libs/abcs/sql/database/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ async def first(
"""
Returns the first object of the query
"""
stmt = stmt.limit(1) # Potential cause for memory leak
res = (await db.scalars(stmt)).first()
res = cast(self.model, res)
self._raise_for_not_found(res, raise_for_not_found)
Expand Down

0 comments on commit ae7eb3f

Please sign in to comment.