Skip to content

Commit

Permalink
Drop components option in query-dataset-types command line
Browse files Browse the repository at this point in the history
Do not forward.
  • Loading branch information
timj committed Jan 5, 2024
1 parent 2237fe4 commit 4280299
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions python/lsst/daf/butler/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ def query_collections(*args: Any, **kwargs: Any) -> None:
@options_file_option()
def query_dataset_types(*args: Any, **kwargs: Any) -> None:
"""Get the dataset types in a repository."""
# Drop the components option.
kwargs.pop("components")
table = script.queryDatasetTypes(*args, **kwargs)
if table:
table.pprint_all()
Expand Down
10 changes: 2 additions & 8 deletions python/lsst/daf/butler/script/queryDatasetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from .._butler import Butler


def queryDatasetTypes(repo: str, verbose: bool, glob: Iterable[str], components: bool | None) -> Table:
def queryDatasetTypes(repo: str, verbose: bool, glob: Iterable[str]) -> Table:
"""Get the dataset types in a repository.
Parameters
Expand All @@ -48,12 +48,6 @@ def queryDatasetTypes(repo: str, verbose: bool, glob: Iterable[str], components:
glob : iterable [`str`]
A list of glob-style search string that fully or partially identify
the dataset type names to search for.
components : `bool` or `None`
If `True`, apply all glob patterns to component dataset type
names as well. If `False`, never apply patterns to components. If
`None` (default), apply patterns to components only if their parent
datasets were not matched by the expression. Fully-specified component
datasets (`str` or `DatasetType` instances) are always included.
Returns
-------
Expand All @@ -63,7 +57,7 @@ def queryDatasetTypes(repo: str, verbose: bool, glob: Iterable[str], components:
"""
butler = Butler.from_config(repo, without_datastore=True)
expression = glob or ...
datasetTypes = butler.registry.queryDatasetTypes(components=components, expression=expression)
datasetTypes = butler.registry.queryDatasetTypes(expression=expression)
if verbose:
table = Table(
array(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cliCmdQueryDatasetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class QueryDatasetTypesCmdTest(CliCmdTestBase, unittest.TestCase):

@staticmethod
def defaultExpected():
return dict(repo=None, verbose=False, glob=(), components=False)
return dict(repo=None, verbose=False, glob=())

@staticmethod
def command():
Expand Down

0 comments on commit 4280299

Please sign in to comment.