From ff0d8f91724850f5157bd2f55a1408773bb7d4f8 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Thu, 5 Sep 2024 13:44:58 -0700 Subject: [PATCH] Change command-line to convert limit=0 to limit=None for API usage --- python/lsst/daf/butler/script/queryDatasets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/lsst/daf/butler/script/queryDatasets.py b/python/lsst/daf/butler/script/queryDatasets.py index 7a1f147f8d..082853a6c3 100644 --- a/python/lsst/daf/butler/script/queryDatasets.py +++ b/python/lsst/daf/butler/script/queryDatasets.py @@ -273,8 +273,9 @@ def getDatasets(self) -> Iterator[DatasetRef]: kwargs: dict[str, Any] = {} if self._where: kwargs["where"] = self._where - if not unlimited: - kwargs["limit"] = limit + # API uses 0 to mean "check query but return nothing" and None + # to mean "unlimited". + kwargs["limit"] = None if unlimited else limit _LOG.debug("Querying dataset type %s with %s", dt, kwargs) results = self.butler.query_datasets( dt,