Skip to content

Commit

Permalink
[vdsql-] use intermediate expr with order_by with filter #1856
Browse files Browse the repository at this point in the history
  • Loading branch information
saulpw committed Jul 7, 2023
1 parent 96ce226 commit a5a6d38
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion visidata/apps/vdsql/_ibis.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,19 @@ def ibis_filter(self):

@property
def pending_expr(self):
import ibis
q = self.get_current_expr(typed=True)
if self.ibis_selection:
q = q.filter(self.ibis_filter)

if self._ordering:
q = q.order_by([(col.get_ibis_col(self.query), not rev) for col, rev in self._ordering])
colorder = []
for col, rev in self._ordering:
ibiscol = col.get_ibis_col(q) #1856
if rev:
ibiscol = ibis.desc(ibiscol)
colorder.append(ibiscol)
q = q.order_by(colorder)

return q

Expand Down

0 comments on commit a5a6d38

Please sign in to comment.