fix(giskard-checks): preserve concrete trace type on scenario results#2326
fix(giskard-checks): preserve concrete trace type on scenario results#2326kevinmessiaen merged 2 commits intomainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an issue where Pydantic's default behavior would cast specific Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to preserve concrete Trace types in scenario results by making ScenarioResult generic over TraceType. This is a good approach for individual scenario runs. However, the implementation for Suite and SuiteResult seems to re-introduce the problem by using a generic SuiteResult[Trace[Any, Any]], which will likely cause Pydantic to cast all trace types to a common base type, losing the specific type information. My review includes several suggestions to make SuiteResult non-generic and use list[ScenarioResult] to correctly handle heterogeneous trace types within a suite. The rest of the changes for Scenario and ScenarioResult look correct.
|
Yes basically this can be done inside the custom |

Updated scenario result final trace type to be generic. Fixing an issue where pydantic would cast to
Traceand losing custom display:New:

Old:
