Skip to content

fix(analyze): handle cached dicts in dataframe conversion#2378

Draft
ryan-arman wants to merge 1 commit intomainfrom
ryan-arman/analyze-dataframe-cache-fix
Draft

fix(analyze): handle cached dicts in dataframe conversion#2378
ryan-arman wants to merge 1 commit intomainfrom
ryan-arman/analyze-dataframe-cache-fix

Conversation

@ryan-arman
Copy link
Copy Markdown
Contributor

@ryan-arman ryan-arman commented Apr 17, 2026

Description

Dataset-level cached results are raw dicts (loaded from the pipeline's JSON cache), not Pydantic instances. to_analysis_dataframe gated the dataset-level branch on isinstance(result, BaseModel), so cached dataset metrics silently disappeared from the returned DataFrame. results_to_dict had the same blind spot on the list branch.

Both entry points now accept dict alongside BaseModel, and the type signatures are broadened to reflect that. Includes regression tests for dataset-level dicts, per-conversation list-of-dicts, and the results_to_dict passthrough.

Part of a 4-PR split of #2370. Standalone — does not depend on the other PRs.

Related issues

Towards OPE-1868

Before submitting

  • This PR only changes documentation. (You can ignore the following checks in that case)
  • Did you read the contributor guideline Pull Request guidelines?
  • Did you link the issue(s) related to this PR in the section above?
  • Did you add / update tests where needed?

Dataset-level cached results are raw dicts (from the pipeline's JSON
cache), not BaseModel instances. `isinstance(result, BaseModel)` silently
skipped them, dropping dataset-level metrics from the DataFrame entirely.

Now both `to_analysis_dataframe` and `results_to_dict` accept `dict` in
addition to `BaseModel`, with the signatures broadened to reflect that.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 17, 2026

Reviewing your code

Gitar

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant