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

Guard against invalid calls to count() in butler query CLI

    XMLWordPrintable

    Details

      Description

      Apparently at least butler query-data-ids calls the count method on a query result object without telling it what to do when counting the results would have to be implemented by iterating over all results and then throwing them away, resulting in an error that uses shouldn't have to see in a high-level call like this:

      https://lsstc.slack.com/archives/C01FBUGM2CV/p1682469497459669

      This bug was introduced in DM-31725, but the behavior before was not great either, as it would have just silently run the query twice and thrown away the results from the first call after counting them.

        Attachments

          Issue Links

            Activity

            Hide
            jbosch Jim Bosch added a comment -

            Andy Salnikov, mind reviewing this small fix (and unit test improvement) for query-data-ids?

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

            Jenkins is underway at https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/38587/pipeline

            Show
            jbosch Jim Bosch added a comment - Andy Salnikov , mind reviewing this small fix (and unit test improvement) for query-data-ids? PR is https://github.com/lsst/daf_butler/pull/833 Jenkins is underway at https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/38587/pipeline
            Hide
            salnikov Andy Salnikov added a comment -

            Looks good, I believe mypy errors should disappear when Tim's ticket is merged.

            Show
            salnikov Andy Salnikov added a comment - Looks good, I believe mypy errors should disappear when Tim's ticket is merged.

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              jbosch Jim Bosch
              Reviewers:
              Andy Salnikov
              Watchers:
              Andy Salnikov, Jim Bosch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.