Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-33584

Sort remove-runs output and filter out non-removed collections

    XMLWordPrintable

    Details

      Description

      DM-32831 added a remove-runs command that prints out all datasets before confirming whether the user wants to delete them. It would be helpful if the output was 1) sorted alphabetically and 2) filtered out datatypes with zero datasets being removed, given that the list of dataset types is long and likely to keep growing.

      I think this would only require changing [this line](https://github.com/lsst/daf_butler/blob/main/python/lsst/daf/butler/cli/cmd/_remove_runs.py#L57), although I suppose the datasets could be passed in pre-sorted instead.

        Attachments

          Issue Links

            Activity

            Hide
            jbosch Jim Bosch added a comment -

            I'm stealing this and doing it now just so I don't have to add a disclaimer about it on DM-33658.

            Show
            jbosch Jim Bosch added a comment - I'm stealing this and doing it now just so I don't have to add a disclaimer about it on DM-33658 .
            Hide
            jbosch Jim Bosch added a comment - - edited

            I've used DM-33584 to run the example commands for DM-33658 and get the output I've copied and pasted in, so we should merge this first to make sure they match up with reality. Adding it as a blocker.

            Show
            jbosch Jim Bosch added a comment - - edited I've used DM-33584 to run the example commands for DM-33658 and get the output I've copied and pasted in, so we should merge this first to make sure they match up with reality. Adding it as a blocker.
            Hide
            jbosch Jim Bosch added a comment -

            Nate Pease [X], this is just some tiny changes to the remove-runs script code. Mind reviewing?

            PR is https://github.com/lsst/daf_butler/pull/643

            I added a unit test for the filtering of datasets with count=0, but I didn't add one for the sorting, given that the implementation is just calling sorted(...) on something and we don't have any way to force the order to be unsorted without this sorting in the test.

            Show
            jbosch Jim Bosch added a comment - Nate Pease [X] , this is just some tiny changes to the remove-runs script code. Mind reviewing? PR is https://github.com/lsst/daf_butler/pull/643 I added a unit test for the filtering of datasets with count=0, but I didn't add one for the sorting, given that the implementation is just calling sorted(...) on something and we don't have any way to force the order to be unsorted without this sorting in the test.
            Hide
            npease Nate Pease [X] (Inactive) added a comment -

            LGTM!

            Show
            npease Nate Pease [X] (Inactive) added a comment - LGTM!

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              dtaranu Dan Taranu
              Reviewers:
              Nate Pease [X] (Inactive)
              Watchers:
              Dan Taranu, Jim Bosch, Nate Pease [X] (Inactive), Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.