Skip to content

Commit

Permalink
Use attrgetter rather than lambda in sort
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Aug 6, 2024
1 parent 65d16c2 commit a254a59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/lsst/daf/butler/script/queryDimensionRecords.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

from __future__ import annotations

from operator import attrgetter
from typing import Any

from astropy.table import Table
Expand Down Expand Up @@ -104,7 +105,7 @@ def queryDimensionRecords(

if not order_by:
# use the dataId to sort the rows if not ordered already
records.sort(key=lambda r: r.dataId)
records.sort(key=attrgetter("dataId"))

# order the columns the same as the record's `field.names`, and add units
# to timespans
Expand Down

0 comments on commit a254a59

Please sign in to comment.