mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 19:59:26 +00:00
fix(learn): the experiment_result row keeps one JSON type per column of its object
An experiment's register, run, result and arm_outcome rows share one object, and RustFS's S3 Select infers one schema per object: exp-002's result row carried `units` as an object beside the run row's integer (and `looks` as objects beside the register row's fractions), and after `analyse --record` no row of the experiment could be read (JSONParsingError). The result row now writes `unit_counts` and `looks_taken`; a test asserts one JSON shape per column across the four row kinds. The live object was repaired by dropping the one row (drop_rows) and recording the analysis again. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
8d45483d10
commit
780caaa558
@@ -755,14 +755,18 @@ def analyse(
|
||||
|
||||
|
||||
def result_row(manifest: Manifest, pin: str, result: Mapping[str, Any]) -> dict[str, Any]:
|
||||
"""The ``experiment_result`` row. It shares one object with the experiment's register, run and outcome rows, and
|
||||
an S3 Select schema is inferred per object, so a column keeps one JSON type across those rows: the unit counts
|
||||
are ``unit_counts`` (the run row's ``units`` is an integer) and the looks ``looks_taken`` (the register row's
|
||||
``looks`` are the fractions)."""
|
||||
tests = result["tests"]
|
||||
return {
|
||||
"id": row_id(RESULT_KIND, f"experiment-{manifest.id}", "analyse", manifest.id), "kind": RESULT_KIND,
|
||||
"repo": experiment_repo(manifest.id), "pin": pin, "run": f"experiment-{manifest.id}", "task": "analyse", "population": POPULATION,
|
||||
"split": manifest.id, "image": "host", "experiment": manifest.id, "manifest_digest": manifest.digest,
|
||||
"decision": result["decision"], "reason": result["reason"], "units": result["units"], "spend_usd": result["spend_usd"],
|
||||
"decision": result["decision"], "reason": result["reason"], "unit_counts": result["units"], "spend_usd": result["spend_usd"],
|
||||
"tests": {n: {"diff": t["estimate"]["diff"], "ci": t["estimate"]["ci"], "ci_vs_zero": t["ci_vs_zero"]} for n, t in tests.items()},
|
||||
"looks": [{"fraction": look["fraction"], "z": look["z"], "crossed": look["crossed"]} for look in result["looks"]],
|
||||
"looks_taken": [{"fraction": look["fraction"], "z": look["z"], "crossed": look["crossed"]} for look in result["looks"]],
|
||||
} # fmt: skip
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user