Fix Limit 0 QuerySet Empty List (#767)
* fix: debug condition check not none limit count * test: write a test for check zero limit empty list * fix: debug assert check empty list with is keyword
This commit is contained in:
@ -20,6 +20,8 @@ class LimitQuery:
|
||||
:return: modified query
|
||||
:rtype: sqlalchemy.sql.selectable.Select
|
||||
"""
|
||||
if self.limit_count:
|
||||
|
||||
if self.limit_count is not None:
|
||||
expr = expr.limit(self.limit_count)
|
||||
|
||||
return expr
|
||||
|
||||
@ -282,10 +282,10 @@ class QuerySet(Generic[T]):
|
||||
filter_clauses=self.filter_clauses,
|
||||
exclude_clauses=self.exclude_clauses,
|
||||
offset=offset or self.query_offset,
|
||||
limit_count=limit or self.limit_count,
|
||||
excludable=self._excludable,
|
||||
order_bys=order_bys or self.order_bys,
|
||||
limit_raw_sql=self.limit_sql_raw,
|
||||
limit_count=limit if limit is not None else self.limit_count,
|
||||
)
|
||||
exp = qry.build_select_expression()
|
||||
# print("\n", exp.compile(compile_kwargs={"literal_binds": True}))
|
||||
|
||||
Reference in New Issue
Block a user