Skip to content

Conversation

@katara-Jayprakash
Copy link

Fixes #284

Signed-off-by: katara-Jayprakash <[email protected]>
Signed-off-by: katara-Jayprakash <[email protected]>
@gemini-code-assist
Copy link

Summary of Changes

Hello @katara-Jayprakash, 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 a critical AttributeError by correcting a method invocation within the lifelong learning paradigm's evaluation process. The change ensures that the correct evaluate method is called and that its return values are handled appropriately, thereby restoring the intended functionality of the evaluation step.

Highlights

  • Bug Fix: Resolved an AttributeError that occurred when attempting to call a non-existent method my_evaluate on a LifelongLearning object.
  • Method Call Correction: The incorrect method call job.my_evaluate was updated to the correct job.evaluate within the my_eval function.
  • Return Value Adjustment: Modified the assignment of the method's return value to correctly handle the output of job.evaluate, removing the unpacking of edge_task_index and tasks_detail which are not returned by the evaluate method.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign jaypume after the PR has been reviewed.
You can assign the PR to them by writing /assign @jaypume in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 9, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a 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 aims to fix an AttributeError by renaming a method call from my_evaluate to evaluate. While this addresses the original error, the change introduces a critical NameError because the function now attempts to return variables that are no longer defined. My review includes a comment with a suggested fix to correctly handle the return values and prevent the new error, ensuring the function's contract with its callers is maintained.

job = self.build_paradigm_job(ParadigmType.LIFELONG_LEARNING.value)
_, metric_func = get_metric_func(model_metric)
edge_task_index, tasks_detail, res = job.my_evaluate(eval_dataset, metrics=metric_func)
res = job.evaluate(eval_dataset, metrics=metric_func)

Choose a reason for hiding this comment

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

critical

This change fixes the AttributeError by replacing job.my_evaluate with job.evaluate. However, it introduces a new critical bug. The my_eval function's return statement on line 423 (return edge_task_index, tasks_detail, res) will now fail with a NameError because the variables edge_task_index and tasks_detail are no longer defined within this function. Callers of my_eval (e.g., on line 108) expect all three return values.

If job.evaluate returns three values, the fix should be to unpack all of them. This would be a direct fix for the AttributeError while preserving the function's contract. If job.evaluate only returns a single value (as its usage in _eval suggests), then this function and its callers need a more significant refactoring to handle the missing values.

Suggested change
res = job.evaluate(eval_dataset, metrics=metric_func)
edge_task_index, tasks_detail, res = job.evaluate(eval_dataset, metrics=metric_func)

Copy link
Author

Choose a reason for hiding this comment

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

@MooreZheng MooreZheng requested review from hsj576 and removed request for Poorunga November 10, 2025 02:26
@MooreZheng
Copy link
Collaborator

@abhishek-8081 is this pull request solved your issue?

@AryanNanda17
Copy link
Contributor

CI check is failing, please check.
Please test this out. @katara-Jayprakash

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

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Core Framework] AttributeError: 'LifelongLearning' object has no attribute 'my_evaluate'

4 participants