Fix bugs in JSON and SQA storage modules #4893
Open
+50
−36
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.
Summary:
Fix multiple bugs in ax/storage:
raisebeforeSQADecodeErrorsilently ignores JSON mismatches duringcopy_db_ids(sqa_store/utils.py:114)int(None)crash in SQA encoder:metric_registry.get()can return None, but the result was immediately passed toint()before the None check could run (sqa_store/encoder.py:393)AttributeErroron None kwargs in JSON decoder:kwargs.pop()was called before theif kwargs is not Noneguard (json_store/decoder.py:1092)decode_args_listlength mismatch in SQA save: usedlen(trials)instead oflen(trials_to_reduce_state)and[...] * len(trials)instead of a single-element list (sqa_store/save.py:245,254)SQAExperiment.id is not Noneuses Python identity check instead of SQLAlchemy's.isnot(None)(sqa_store/load.py:760)> 15(sqa_store/utils.py:77)ax/ax/storagein error message (sqa_store/encoder.py:131)Differential Revision: D92879499