Skip to content

Commit

Permalink
Add exception for query-dimension-records offset
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dhirving committed Oct 15, 2024
1 parent 2ab58b0 commit 84cf62c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/changes/DM-46599.removal.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/daf/butler/script/queryDataIds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions python/lsst/daf/butler/script/queryDimensionRecords.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 84cf62c

Please sign in to comment.