Skip to content

Commit

Permalink
List chained collection children in search order.
Browse files Browse the repository at this point in the history
The TABLE mode of butler query-collections, unlike the default TREE,
listed child collections in alphabetical order. This has now been
changed to match TREE's behavior. No changes were needed for FLATTEN,
which ignores chains anyway.
  • Loading branch information
kfindeisen committed Jan 24, 2024
1 parent 92313a9 commit 1007d69
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/changes/DM-42605.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
butler query-collections --chains=TABLE now lists children in search order, not alphabetical order.
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/queryCollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _getTable(
children = butler.registry.getCollectionChain(name)
if children:
first = True
for child in sorted(children):
for child in children:
table.add_row((name if first else "", type.name if first else "", child))
first = False
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cliCmdQueryCollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def testChained(self):
array(
(
("calibration1", "CALIBRATION", ""),
("chain1", "CHAINED", "chain2"),
("chain1", "CHAINED", "tag1"),
("", "", "run1"),
("", "", "tag1"),
("", "", "chain2"),
("chain2", "CHAINED", "calibration1"),
("", "", "run1"),
("imported_g", "RUN", ""),
Expand Down

0 comments on commit 1007d69

Please sign in to comment.