Skip to content

fixing grading step#294

Merged
ArthurCRodrigues merged 1 commit intomainfrom
293-broken-grading
Apr 16, 2026
Merged

fixing grading step#294
ArthurCRodrigues merged 1 commit intomainfrom
293-broken-grading

Conversation

@matheusmra
Copy link
Copy Markdown
Member

@matheusmra matheusmra commented Apr 15, 2026

model_config was forbid across autograder models, leading to a error during the grading step.
This pull requests fix this issue, updating model_config to allow.

Copilot AI review requested due to automatic review settings April 15, 2026 12:10
@matheusmra matheusmra linked an issue Apr 15, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@matheusmra
Copy link
Copy Markdown
Member Author

@ArthurCRodrigues

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

if self.parameters:
kwargs.update({param.name: param.value for param in self.parameters})

if self.model_extra:
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_kwargs_dict() merges model_extra after the explicit parameters list, so an extra-field with the same key will silently override an explicitly declared parameter. That can lead to unexpected behavior when both mechanisms are used together. Consider either (a) applying model_extra first and then letting parameters win, or (b) detecting key collisions and raising a validation error.

Suggested change
if self.model_extra:
if self.model_extra:
conflicting_keys = set(kwargs).intersection(self.model_extra)
if conflicting_keys:
conflicting_keys_str = ", ".join(sorted(conflicting_keys))
raise ValueError(
"Duplicate keyword argument definitions found in "
f"'parameters' and extra fields: {conflicting_keys_str}"
)

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +46
if self.model_extra:
kwargs.update(self.model_extra)
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behavior adds model_extra into the kwargs returned by get_kwargs_dict(), but the unit tests only cover the parameters-list path. Add a test that sets an extra field on TestConfig and asserts it appears in get_kwargs_dict() (and that precedence/collision behavior is as intended).

Copilot uses AI. Check for mistakes.
test_function = self.__find_test_function(function_name)
if not test_function:
raise ValueError(f"Couldn't find test {config.name}")
raise ValueError(f"Couldn't find test function '{function_name}'")
Copy link

Copilot AI Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lookup failure error now reports only the resolved function_name. Since name is now a display label and type is optional, this message can be hard to map back to the original config entry. Consider including both config.name and config.type (and possibly config.file when present) and explicitly hinting that type should match the template registry key.

Suggested change
raise ValueError(f"Couldn't find test function '{function_name}'")
file_details = f", file='{config.file}'" if config.file else ""
raise ValueError(
f"Couldn't find test function '{function_name}' for test config "
f"name='{config.name}', type='{config.type}'{file_details}. "
f"Ensure 'type' matches the template registry key."
)

Copilot uses AI. Check for mistakes.
@ArthurCRodrigues ArthurCRodrigues merged commit fd4170e into main Apr 16, 2026
6 checks passed
@ArthurCRodrigues ArthurCRodrigues deleted the 293-broken-grading branch April 16, 2026 10:37
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.

broken Grading

3 participants