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

tickets/dm 10221 Don't restrict the acceptable keys to those returned by butler.getKeys #30

Merged
merged 1 commit into from
Apr 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
10 changes: 8 additions & 2 deletions python/lsst/pipe/base/argumentParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ def castDataIds(self, butler):
try:
keyType = idKeyTypeDict[key]
except KeyError:
validKeys = sorted(idKeyTypeDict.keys())
raise KeyError("Unrecognized ID key %r; valid keys are: %s" % (key, validKeys))
# OK, assume that it's a valid key and guess that it's a string
keyType = str

log = lsstLog.Log.getDefaultLogger()
log.warn("Unexpected ID %s; guessing type is \"%s\"" %
(key, 'str' if keyType == str else keyType))
idKeyTypeDict[key] = keyType

if keyType != str:
try:
castVal = keyType(strVal)
Expand Down