-
Notifications
You must be signed in to change notification settings - Fork 3
Respect selected eval type for budeval runs #974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary of ChangesHello @dittops, 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 enhances the Highlights
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the evaluation triggering logic to respect the eval_type selected in the workflow, defaulting to 'gen' if not specified. It correctly adds validation to ensure that datasets support the requested evaluation type, raising an exception for mismatches. The changes also improve error handling by re-raising exceptions instead of swallowing them, and by failing fast on configuration issues, which enhances robustness. My feedback includes a couple of suggestions to simplify the code by removing redundant checks, which will improve readability and maintainability.
| workflow_data = await self._get_accumulated_step_data(workflow_id) | ||
| step_five_data = workflow_data.get("step_5", {}) if isinstance(workflow_data, dict) else {} | ||
|
|
||
| requested_eval_type_raw = step_five_data.get("eval_type") if isinstance(step_five_data, dict) else None | ||
| requested_eval_type = str(requested_eval_type_raw).lower() if requested_eval_type_raw else "gen" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for retrieving requested_eval_type is a bit overly defensive. The _get_accumulated_step_data method is type-hinted to return a dict, and its implementation ensures it. The multiple isinstance checks can be simplified, making the code more concise and readable.
| workflow_data = await self._get_accumulated_step_data(workflow_id) | |
| step_five_data = workflow_data.get("step_5", {}) if isinstance(workflow_data, dict) else {} | |
| requested_eval_type_raw = step_five_data.get("eval_type") if isinstance(step_five_data, dict) else None | |
| requested_eval_type = str(requested_eval_type_raw).lower() if requested_eval_type_raw else "gen" | |
| workflow_data = await self._get_accumulated_step_data(workflow_id) | |
| step_five_data = workflow_data.get("step_5", {}) | |
| requested_eval_type_raw = step_five_data.get("eval_type") | |
| requested_eval_type = str(requested_eval_type_raw).lower() if requested_eval_type_raw else "gen" |
| logger.warning(f"Run {run.id}: Dataset '{dataset.name}' has no 'gen' eval_type") | ||
| dataset_config = eval_types.get(requested_eval_type) | ||
| if not dataset_config: | ||
| available_types = ", ".join(eval_types.keys()) if eval_types else "none" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The if eval_types check here is redundant. This code is inside a block that has already confirmed eval_types is a truthy dictionary (if eval_types and isinstance(eval_types, dict):). Removing this unnecessary conditional will make the code slightly cleaner.
| available_types = ", ".join(eval_types.keys()) if eval_types else "none" | |
| available_types = ", ".join(eval_types.keys()) |
Summary
Testing
Codex Task