Skip to content

Commit

Permalink
[sort-] order with Columns ASAP, not colnames #2494
Browse files Browse the repository at this point in the history
  • Loading branch information
midichef committed Aug 9, 2024
1 parent 253e314 commit 07e7406
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions visidata/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ def sort(self):
return
try:
with Progress(gerund='sorting', total=self.nRows) as prog:
ordering = self.ordering
# replace ambiguous colname strings with unambiguous Column objects #2494
self._ordering = self.ordering
def _sortkey(r):
prog.addProgress(1)
return self.sortkey(r, ordering=ordering)
return self.sortkey(r, ordering=self._ordering)

# must not reassign self.rows: use .sort() instead of sorted()
self.rows.sort(key=_sortkey)
Expand Down

1 comment on commit 07e7406

@frosencrantz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you saw a comment on this this commit from me. The problem was on my side. I have deleted the comment.

Please sign in to comment.