Repository navigation
fix(ctf): reject None for numeric detector config keys - #605
Open
Prasad-desh wants to merge 3 commits into
Open
Prasad-desh wants to merge 3 commits into
Prasad-desh wants to merge 3 commits into
Conversation
Signed-off-by: Prasad Deshpande <officiallyprasad@gmail.com>
Signed-off-by: Prasad Deshpande <officiallyprasad@gmail.com>
Signed-off-by: Prasad Deshpande <officiallyprasad@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to the note at the end of #594, which flagged these two but left them out of that PR.
_validate_configguards the range check withif <value> is not None, so a config that carries the key with an empty YAML value passes construction.check_eventthen reads the key back with.get(key, DEFAULT), which returnsNonerather than the default once the key is present, and the first comparison raisesTypeError. The detector is down for the rest of the process after that.Confirmed on
mainbefore the change:Checking for the key's presence instead, same as #594 did for the list-typed keys.
The two
Nonetests fail onmainand pass with the fix.tests/unit/ctfis 39 passed, 1 skipped before and after. Tests are in their own file so they don't collide with #136, which addstest_detectors.py.Independent of #594, so either can go in first.