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

DM-25222: Fix handling of skip-existing in PreExecInit #55

Merged
merged 2 commits into from Jun 4, 2020

Conversation

andy-slac
Copy link
Collaborator

PreExecInit expected butler.get() to return None for missing datasets,
while in reality it raises LookupError. Fixing this and also adding unit
test for this.

objFromStore = self.butler.get(attribute.name, {})
if objFromStore is not None:
try:
objFromStore = self.butler.get(attribute.name, {})
# Types are supposed to be identical.
Copy link
Member

Choose a reason for hiding this comment

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

Datastore.get does check that the returned python object is an instance of the StorageClass python type. It does not require that types match directly. Your test here is more stringent than butler -- does it ever trigger?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have no idea, probably not because we did not see any questions/complaints about this. What we want to do is to make sure that objects are identical but there is no way to do it now for arbitrary types, checking that types are identical is the minimum that we can do here.

PreExecInit expected butler.get() to return None for missing datasets,
while in reality it raises LookupError. Fixing this and also adding unit
test for this.
Copy link
Contributor

@MichelleGower MichelleGower left a comment

Choose a reason for hiding this comment

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

With these changes I was able to successfully run.

@andy-slac andy-slac merged commit dbd5a8a into master Jun 4, 2020
@andy-slac andy-slac deleted the tickets/DM-25222 branch September 11, 2020 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants