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

Fixing "No Data Available" in GenerateRecommendations API #1418

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

shekhar316
Copy link
Contributor

Description

This PR fixes issue with generatedRecommendations API. After the recent changes we were facing issue with error There is not enough data available to generate a recommendation every time.

Fixes # (issue)

  • There is not enough data available to generate a recommendation error in generatedRecommendations API

Type of change

  • Bug fix
  • New feature
  • Docs update
  • Breaking change (What changes might users need to make in their application due to this PR?)
  • Requires DB changes

How has this been tested?

Test Configuration

  • Kubernetes clusters tested on: Openshift Cluster

Checklist 🎯

  • Followed coding guidelines
  • Comments added
  • Dependent changes merged
  • Documentation updated
  • Tests added or updated

Additional information

The debug log showed that the containerData was null. Upon further debugging, found that metrics were not being fetched because the metricList was empty. Digging deeper, discovered that directly comparing the experimentType using the equals function was returning false, even for seemingly equivalent values. This issue was resolved by converting the experimentType to a String using .name() and performing the comparison, which avoids potential pitfalls associated with enum equality checks.

By relying on .name() for comparison, we mitigate issues such as case sensitivity or mismatches caused by runtime discrepancies (e.g., different instances of the same enum under different class loaders). This approach ensures robust and predictable behavior when comparing enum values.

Copy link
Contributor

@msvinaykumar msvinaykumar left a comment

Choose a reason for hiding this comment

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

LGTM

@dinogun dinogun merged commit fceb476 into kruize:mvp_demo Dec 13, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants