Skip to content

Commit

Permalink
remove components arg from queryDatasetTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
n8pease committed Jun 4, 2020
1 parent a960204 commit ac7bb4d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
9 changes: 1 addition & 8 deletions python/lsst/daf/butler/cli/cmd/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,6 @@ def query_collections(*args, **kwargs):

@click.command()
@repo_argument(required=True)
@click.option("--components/--no-components",
default=None,
help="For --components, apply all expression patterns to component dataset type names as well. "
"For --no-components, never apply patterns to components. Default (where neither is "
"specified) is to 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.")
def query_dataset_types(*args, **kwargs):
"""Get the dataset types whose names match an expression."""
"""Get the dataset types in a repository."""
print(yaml.dump(cli_handle_exception(queryDatasetTypes, *args, **kwargs)))
6 changes: 4 additions & 2 deletions python/lsst/daf/butler/script/queryDatasetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
from .. import Butler


def queryDatasetTypes(repo, components):
def queryDatasetTypes(repo):
"""Get the dataset types in a repository.
"""
butler = Butler(repo)
datasetTypes = butler.registry.queryDatasetTypes(components=components)
datasetTypes = butler.registry.queryDatasetTypes()
return {'dataset-types': [datasetType.name for datasetType in datasetTypes]}
16 changes: 4 additions & 12 deletions tests/test_cliCmdQueryDatasetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,18 @@

class QueryDatasetTypesCmdTest(MockeredTestBase):

defaultExpected = dict(repo=None,
components=None)
defaultExpected = dict(repo=None)

def test_minimal(self):
"""Test only the required parameters, and omit the optional parameters.
def test_all(self):
"""Test the required parameter.
"""
self.run_test(["query-dataset-types", "here"],
self.makeExpected(repo="here"))

def test_requiredMissing(self):
"""Test that a missing required parameter fails"""
"""Test that if the required parameter is missing it fails"""
self.run_missing(["query-dataset-types"], 'Error: Missing argument "REPO".')

def test_all(self):
"""Test all parameters"""
self.run_test(["query-dataset-types", "here",
"--components"],
self.makeExpected(repo="here",
components=True))


class QueryDatasetTypesScriptTest(unittest.TestCase):

Expand Down

0 comments on commit ac7bb4d

Please sign in to comment.