Fix bugs in JSON and SQA storage modules#4893
Open
saitcakmak wants to merge 1 commit intofacebook:mainfrom
Open
Fix bugs in JSON and SQA storage modules#4893saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak wants to merge 1 commit intofacebook:mainfrom
Conversation
|
@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D92879499. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4893 +/- ##
==========================================
- Coverage 96.80% 96.79% -0.01%
==========================================
Files 595 595
Lines 63122 63123 +1
==========================================
- Hits 61108 61103 -5
- Misses 2014 2020 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
saitcakmak
added a commit
to saitcakmak/Ax
that referenced
this pull request
Feb 17, 2026
Summary: Fix multiple bugs in ax/storage: - Missing `raise` before `SQADecodeError` silently ignores JSON mismatches during `copy_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 to `int()` before the None check could run (sqa_store/encoder.py:393) - `AttributeError` on None kwargs in JSON decoder: `kwargs.pop()` was called before the `if kwargs is not None` guard (json_store/decoder.py:1092) - `decode_args_list` length mismatch in SQA save: used `len(trials)` instead of `len(trials_to_reduce_state)` and `[...] * len(trials)` instead of a single-element list (sqa_store/save.py:245,254) - SQLAlchemy filter no-op: `SQAExperiment.id is not None` uses Python identity check instead of SQLAlchemy's `.isnot(None)` (sqa_store/load.py:760) - Inconsistent threshold in error message: says "> 10" but the actual check is `> 15` (sqa_store/utils.py:77) - Garbled error message in with_db_settings_base.py: sentence fragments in wrong order (sqa_store/with_db_settings_base.py:106) - Doubled path `ax/ax/storage` in error message (sqa_store/encoder.py:131) - Backslash line-continuation inside string literal causes 16 extra spaces in error message (sqa_store/encoder.py:654) - Missing space between concatenated strings (sqa_store/db.py) - Typo "SCalarized" → "Scalarized" (sqa_store/encoder.py) - Missing space in SKIP_ATTRS_ERROR_SUFFIX (sqa_store/utils.py) Differential Revision: D92879499
14f89cb to
c3f4e9c
Compare
Summary: Fix multiple bugs in ax/storage: - Missing `raise` before `SQADecodeError` silently ignores JSON mismatches during `copy_db_ids` (sqa_store/utils.py:114). Move `baseline_workflow_inputs` from `JSON_ATTRS` to `COPY_DB_IDS_ATTRS_TO_SKIP` since it is a plain JSON dict with no `_db_id` fields and can legitimately differ between encode/decode cycles. - `int(None)` crash in SQA encoder: `metric_registry.get()` can return None, but the result was immediately passed to `int()` before the None check could run (sqa_store/encoder.py:393) - `AttributeError` on None kwargs in JSON decoder: `kwargs.pop()` was called before the `if kwargs is not None` guard (json_store/decoder.py:1092) - `decode_args_list` length mismatch in SQA save: used `len(trials)` instead of `len(trials_to_reduce_state)` and `[...] * len(trials)` instead of a single-element list (sqa_store/save.py:245,254) - SQLAlchemy filter no-op: `SQAExperiment.id is not None` uses Python identity check instead of SQLAlchemy's `.isnot(None)` (sqa_store/load.py:760) - Inconsistent threshold in error message: says "> 10" but the actual check is `> 15` (sqa_store/utils.py:77) - Garbled error message in with_db_settings_base.py: sentence fragments in wrong order (sqa_store/with_db_settings_base.py:106) - Doubled path `ax/ax/storage` in error message (sqa_store/encoder.py:131) - Backslash line-continuation inside string literal causes 16 extra spaces in error message (sqa_store/encoder.py:654) - Missing space between concatenated strings (sqa_store/db.py) - Typo "SCalarized" → "Scalarized" (sqa_store/encoder.py) - Missing space in SKIP_ATTRS_ERROR_SUFFIX (sqa_store/utils.py) Differential Revision: D92879499
c3f4e9c to
a09d6fe
Compare
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.
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