Skip to content

Conversation

@mgrange1998
Copy link
Contributor

Summary:
Adds testing for skip_runners_and_metrics for with and without reduced_state being specified. T219831930

Adds three tests below

  1. test_load_without_skip_raises_json_decode_error
  2. test_load_experiment_with_aux_exp_and_custom_metric_in_gen_metadata
  3. test_resave_experiment_with_aux_exp_loses_custom_metrics_and_runner

JSON Decoding Error

ApplicationError: (<ApplicationErrorType.UNKNOWN: 0>, 'JSONDecodeError("The JSON 
dictionary passed to `object_from_json` has a type Deltoid3Metric that is not registered with a corresponding class in DECODER_REGISTRY. 
Please see our storage tutorial (https://ax.dev/docs/storage.html) for more details (\'Customizing\' section will be relevant for saving Ax object subclasses).")')

Differential Revision: D91349882

@meta-codesync
Copy link

meta-codesync bot commented Jan 23, 2026

@mgrange1998 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D91349882.

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 23, 2026
@codecov-commenter
Copy link

codecov-commenter commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.71%. Comparing base (1eb22a8) to head (76d4ad6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4817   +/-   ##
=======================================
  Coverage   96.71%   96.71%           
=======================================
  Files         586      587    +1     
  Lines       61323    61398   +75     
=======================================
+ Hits        59309    59384   +75     
  Misses       2014     2014           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…nd_metrics=True)

Summary:
Adds testing for skip_runners_and_metrics for with and without reduced_state being specified. Covers unique specific scenarios related to 
- loading experiment with unregistered metrics in the auxiliary experiment
- verifying that loading w/ skipped_runners_and_metric experiment, re-saving and loading again results in loaded metric having base Metric and no runner. 


Backlog task: T219831930


# Test breakdown

Adds three tests below
1. test_load_without_skip_raises_json_decode_error: Tests scenario where auxiliary experiments contain unregistered custom metric types
2. test_load_experiment_with_aux_exp_and_custom_metric_in_gen_metadata - Tests througoughly saving and loading a full experiment with runners, metrics, auxiliary experiments etc.
3. test_resave_experiment_with_aux_exp_loses_custom_metrics_and_runner - Tests the expected data loss when resaving an experiment loaded with skip_runners_and_metrics

See post for context: https://fb.workplace.com/groups/aeeng/permalink/1876479416444079/

# Caveat

Root cause

```
All PLBO experiments are affected, because they have: 

PE auxiliary experiments… 
… that contain serialized `Metric` objects (`Deltoid3Metric` in this case)... 
… in the `gen_metadata` JSON blobs stored on their generator runs. 

The error comes up when we try to load affected experiments in AxService, which in turn attempts loading their auxiliary experiments, which have the `Deltoid3Metric` objects that AxService cannot decode. This part of the behavior is correct. Explanation in Q1 below.
```

These tests wouldn't have prevented the above scenario from the post from happening directly, but provide insight and testability into this flow from unit test perspective.


# Note

Created a new test file instead of extending test_sqa_store.py because the test file will need to be split up soon due to long length. (See backlog task T252573245)

Reviewed By: mpolson64

Differential Revision: D91349882
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants