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

obs_base/DM-8230: Strip skymap data ID keys from registry queries. #13

Merged
merged 1 commit into from Nov 15, 2016

Conversation

TallJimbo
Copy link
Member

This change could be considerably simplified by changing the API of mapping.lookup() to return via a dict instead of a list, but for now I feel it's better to leave this as a self-contained change that
doesn't break any other code.

fastPath = True
for p in properties:
if p not in ('filter', 'expTime', 'taiObs'):
fastPath = False
break
if fastPath and 'visit' in dataId and "raw" in self.tables:
lookupDataId = {'visit': dataId['visit']}
self.registry.lookup(properties, 'raw_visit', lookupDataId)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this effectively a no-op before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't noticed that fully until now, but I think it was indeed an unintentional no-op - I think it was supposed to return on this line, which would indeed have short-circuited the rest.

I also think this code path is very rarely invoked, because the all butler methods that eventually lead to lookup calls tend to include all data ID keys (including e.g. visit and ccd) in properties, not just the missing ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it might have gone from optimization to no-op in e522602. The intent was for it to be invoked fairly frequently, but perhaps that also went by the wayside a while ago.

This change could be considerably simplified by changing the API
of mapping.lookup() to return via a dict instead of a list, but for
now I feel it's better to leave this as a self-contained change that
doesn't break any other code.
@TallJimbo TallJimbo merged commit 7fd62fb into master Nov 15, 2016
@ktlim ktlim deleted the tickets/DM-8230 branch August 25, 2018 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants