Implement python 'or' operator for fallback keys - #53
Conversation
c69fda5 to
00ce3a3
Compare
gjclark
left a comment
There was a problem hiding this comment.
Great changes! This means that we should be able to modify our metaspecs that allow both keys to be optional whenever we have time to.
|
Which ones are you referring to? Just because of how the whole template processing works in mandible, both the left and right sides of the 'or' operator will be processed when the template is evaluated. So if you have a |
I was thinking here: I was actually going to suggest even linking this PR in that comment so that it's clear when "mandible supports fallback mappings." |
|
OK, yep! Although I don't think I'm going to actually make that change on the PR right now because I don't want to deal with having to make a new mandible release and update the dependencies. Because if we update mandible, we'd probably want to update it for all workflows so everything is on the same version, but that would mean applying that same change to the consolidated repo, so I'd rather just wait until we're done migrating stuff there and then do the update only once in the consolidated repo. |
Absolutely |
It is starting to come up more often that we need to try getting data from one key, and fall back to a different key if the first doesn't exist. Currently this needs to be implemented by setting up two items in the template and then resolving the fallback during the UMM-G generation step, using these changes, it could be implemented directly in the metaspec file.
Pull Request Checklist
I have: