Skip to content

Commit

Permalink
Issue warning from butler query-dataset-types if --[no-]components used
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jan 5, 2024
1 parent 4280299 commit cbbeb84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion python/lsst/daf/butler/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,10 @@ def query_collections(*args: Any, **kwargs: Any) -> None:
def query_dataset_types(*args: Any, **kwargs: Any) -> None:
"""Get the dataset types in a repository."""
# Drop the components option.
kwargs.pop("components")
components = kwargs.pop("components")
if components is not None:
comp_opt_str = "" if components else "no-"
click.echo(f"WARNING: --{comp_opt_str}components option is deprecated and will be removed after v27.")

Check warning on line 449 in python/lsst/daf/butler/cli/cmd/commands.py

View check run for this annotation

Codecov / codecov/patch

python/lsst/daf/butler/cli/cmd/commands.py#L448-L449

Added lines #L448 - L449 were not covered by tests
table = script.queryDatasetTypes(*args, **kwargs)
if table:
table.pprint_all()
Expand Down
4 changes: 2 additions & 2 deletions python/lsst/daf/butler/cli/opt/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ def makeCollectionTypes(

components_option = MWOptionDecorator(
"--components/--no-components",
default=False,
default=None,
help=unwrap(
"""For --components, apply all expression patterns to
component dataset type names as well. For --no-components,
never apply patterns to components. Only --no-components
is now supported."""
is now supported. Option will be removed after v27."""
),
)

Expand Down

0 comments on commit cbbeb84

Please sign in to comment.