validate tagged objects using schema for tag #1737
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Passing a
Tagged
object to a validator with a custom schema fails to validate theTagged
object using the schema associated with the tag.This bug is impacting
roman_datamodels
(which uses this pattern for assignment validation). Without this PR the following will not raise aValidationError
:With this PR a
ValidationError
is raised ('a' is not one of ['WFI']
).This PR adds a test for that issue and fixes it by shuffling around a few items in the validator (so that tags trigger schema lookups even if a custom schema was provided to the validator).
This shuffling had the side effect of changing the validation error for one test (
test_history
) to what looks like a more helpful message.This PR includes some changes from #1729 which should be merged first.
Running roman regtests as this will change how validation on assignment behaves: https://plwishmaster.stsci.edu:8081/job/RT/job/Roman-Developers-Pull-Requests/605/
Checklist: