Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daf_persistence: finish removing 'key' arg from queryMetadata #60

Merged
merged 1 commit into from
Jun 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 5 additions & 11 deletions python/lsst/daf/persistence/butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,37 +746,31 @@ def getKeys(self, datasetType=None, level=None, tag=None):
break
return keys

def queryMetadata(self, datasetType, format=None, dataId={}, **rest):
def queryMetadata(self, datasetType, format, dataId={}, **rest):
"""Returns the valid values for one or more keys when given a partial
input collection data id.

Parameters
----------
datasetType - str
The type of dataset to inquire about.
key - str
A key giving the level of granularity of the inquiry.
format - str, tuple
An optional key or tuple of keys to be returned.
Key or tuple of keys to be returned.
dataId - DataId, dict
The partial data id.
**rest -
Keyword arguments for the partial data id.

Returns
-------
A list of valid values or tuples of valid values as specified by the format (defaulting to the same as
the key) at the key's level of granularity.
A list of valid values or tuples of valid values as specified by the
format.
"""

datasetType = self._resolveDatasetTypeAlias(datasetType)
dataId = DataId(dataId)
dataId.update(**rest)

if format is None:
format = (key,)
else:
format = sequencify(format)
format = sequencify(format)

tuples = None
for repoData in self._repos.inputs():
Expand Down