-
Notifications
You must be signed in to change notification settings - Fork 240
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
#2570 Issue: Update config.py #2597
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2597 +/- ##
===========================================
- Coverage 91.16% 83.56% -7.61%
===========================================
Files 494 494
Lines 45350 45374 +24
===========================================
- Hits 41342 37915 -3427
- Misses 4008 7459 +3451
... and 81 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Please address the comment and fix 2 precommit jobs: common unit tests and type checks.
@@ -127,13 +128,17 @@ def _is_path_to_algorithm_name(path_parts: List[str]) -> bool: | |||
def validate(loaded_json): | |||
try: | |||
jsonschema.validate(loaded_json, NNCFConfig.schema()) | |||
|
|||
except JsonSchemaValidationError as e: | |||
logger.error('Invalid NNCF config supplied!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this error handler? Isn't it the same as the next one? Shouldn't the next one executed?
Due to the lack of activity @LalitSP was unassigned from the issue and PR is closed |
Changes
Updated the validation logic in the config.py file to handle errors related to additional properties not defined in the schema. Added checks to raise a more informative ValidationError when unexpected properties are encountered during validation.
Reason for changes
The current error reporting mechanism in the JSON schema validation is misleading, especially when encountering unexpected properties in the configuration.
Related tickets
Ticket ID: 94933
Tests
test $pytest tests/torch/test_config_schema.py -sv -k 'bug_in_error_report'