From 84cf62c3d361033edf88c7f5e8321128f323602c Mon Sep 17 00:00:00 2001 From: "David H. Irving" Date: Tue, 15 Oct 2024 16:14:47 -0700 Subject: [PATCH] Add exception for query-dimension-records offset The --offset parameter to query-dimension-records was changed to be silently ignored in DM-45556. It can't be brought back without going back to the old query system. We are removing this entirely soon, and it's better to flag the problem to the user than silently ignore what they asked for. Also added a little more information to a similar information that was being thrown from query-data-ids. --- doc/changes/DM-46599.removal.md | 2 +- python/lsst/daf/butler/script/queryDataIds.py | 2 +- python/lsst/daf/butler/script/queryDimensionRecords.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/changes/DM-46599.removal.md b/doc/changes/DM-46599.removal.md index 088d25feec..ef83ace4b2 100644 --- a/doc/changes/DM-46599.removal.md +++ b/doc/changes/DM-46599.removal.md @@ -12,7 +12,7 @@ The `--no-check` parameter to `butler query-dimension-records` is now deprecated The `offset` argument to `limit()` for `Registry.queryDataIds` and `Registry.queryDimensionRecords` result objects is now deprecated. -The `--offset` option for `butler query-data-ids` and `butler-query-datasets` is now deprecated. +The `--offset` option for `butler query-data-ids` and `butler-query-datasets` is no longer supported, and will raise on exception if you attempt to use it. It will soon become mandatory to explicitly provide `--collections` and a dataset type search when calling `butler query-datasets`. diff --git a/python/lsst/daf/butler/script/queryDataIds.py b/python/lsst/daf/butler/script/queryDataIds.py index 12f0e59407..b6226fb88d 100644 --- a/python/lsst/daf/butler/script/queryDataIds.py +++ b/python/lsst/daf/butler/script/queryDataIds.py @@ -139,7 +139,7 @@ def queryDataIds( `~lsst.daf.butler.Registry.queryDataIds`. """ if offset: - raise RuntimeError("Offset is no longer supported by the query system.") + raise NotImplementedError("--offset is no longer supported. It will be removed after v28.") butler = Butler.from_config(repo, without_datastore=True) diff --git a/python/lsst/daf/butler/script/queryDimensionRecords.py b/python/lsst/daf/butler/script/queryDimensionRecords.py index 54dc8249f8..272ef5563a 100644 --- a/python/lsst/daf/butler/script/queryDimensionRecords.py +++ b/python/lsst/daf/butler/script/queryDimensionRecords.py @@ -77,6 +77,9 @@ def queryDimensionRecords( `~lsst.daf.butler.Registry.queryDimensionRecords` except for ``no_check``, which is the inverse of ``check``. """ + if offset: + raise NotImplementedError("--offset is no longer supported. It will be removed after v28.") + butler = Butler.from_config(repo, without_datastore=True) with butler.query() as query: