From 07e7406963e30b9d7ca1c4762e6c7b2521539420 Mon Sep 17 00:00:00 2001 From: midichef <67946319+midichef@users.noreply.github.com> Date: Fri, 9 Aug 2024 15:07:20 -0700 Subject: [PATCH] [sort-] order with Columns ASAP, not colnames #2494 --- visidata/sort.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/visidata/sort.py b/visidata/sort.py index 41d72a59f..fb7255859 100644 --- a/visidata/sort.py +++ b/visidata/sort.py @@ -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)