Skip to content
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

bugfix/aqua.evaluation #761

Merged
merged 5 commits into from
Apr 19, 2024
Merged

bugfix/aqua.evaluation #761

merged 5 commits into from
Apr 19, 2024

Conversation

mingkang111
Copy link
Member

@mingkang111 mingkang111 commented Apr 8, 2024

Description

This PR aims to fix the following problem:

  • potential NPE
  • AttributeError cannot be caught correctly

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 8, 2024
@mingkang111 mingkang111 changed the base branch from main to feature/aqua_testing April 8, 2024 21:37
Copy link

github-actions bot commented Apr 8, 2024

📌 Cov diff with main:

Coverage-0%

📌 Overall coverage:

Coverage-21.38%

@@ -1265,7 +1273,10 @@ def cancel(self, eval_id) -> dict:
raise AquaRuntimeError(
f"Failed to get evaluation details for model {eval_id}"
)
job_run_id = model.provenance_metadata.training_id

job_run_id = (
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the fix for the existing potential bug in production: when model.provenance_metadata is None, the function will break.

@@ -1328,7 +1339,7 @@ def delete(self, eval_id):
job_id = model.custom_metadata_list.get(
EvaluationCustomMetadata.EVALUATION_JOB_ID.value
).value
except ValueError:
except Exception:
Copy link
Member Author

Choose a reason for hiding this comment

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

model.custom_metadata_list can be None for DataScienceModel, which will give 500 AttributeError from ads. We need to make it as AquaMissingKeyError as well.

@@ -1538,20 +1550,6 @@ def _build_resource_identifier(
)
return AquaResourceIdentifier()

def _get_jobrun(
Copy link
Member Author

Choose a reason for hiding this comment

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

The function has not been used. So it is safe to remove it.

Copy link
Member

@VipulMascarenhas VipulMascarenhas left a comment

Choose a reason for hiding this comment

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

can we revert the changes in evaluation.py and add the changes separately later on? This PR will change the current behavior in production even if the intention is to fix bugs. All these changes can go as a part of the next set of improvements/bug fixes later on.

@mingkang111
Copy link
Member Author

can we revert the changes in evaluation.py and add the changes separately later on? This PR will change the current behavior in production even if the intention is to fix bugs. All these changes can go as a part of the next set of improvements/bug fixes later on.

These changes as I commented, are worthwhile to be fixed. They didn't touch the main logic. I believe it is the reason for writing test: to find the bug and fix them. I will keep this PR open to be merged later.
I also prepared another PR: #763 which is the version that adding test without the change in evaluation.py. In case @mayoor prefer to merge those first.

@mingkang111 mingkang111 changed the title Unittest for aqua.evaluation [DONT'T MERGE] Unittest for aqua.evaluation Apr 9, 2024
@mingkang111 mingkang111 changed the base branch from feature/aqua_testing to feature/aquav1.0.1 April 18, 2024 18:03
@mingkang111 mingkang111 changed the title [DONT'T MERGE] Unittest for aqua.evaluation bugfix/aqua.evaluation Apr 18, 2024
@mingkang111 mingkang111 requested review from VipulMascarenhas, mayoor, mrDzurb and qiuosier and removed request for lu-ohai April 18, 2024 18:38
Copy link
Member

@VipulMascarenhas VipulMascarenhas left a comment

Choose a reason for hiding this comment

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

thanks for this PR, changes look good.

@mingkang111 mingkang111 merged commit 4c9c349 into feature/aquav1.0.1 Apr 19, 2024
6 checks passed
@mingkang111 mingkang111 deleted the ming/aqua_test branch April 19, 2024 18:04
mingkang111 added a commit that referenced this pull request Apr 19, 2024
ads/aqua/evaluation.py Show resolved Hide resolved
ads/aqua/evaluation.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants