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

[FSSDK-10763] Implement UPS request batching for decideForKeys #440

Merged
merged 29 commits into from
Nov 27, 2024

Conversation

FarhanAnjum-opti
Copy link
Contributor

Summary

  • Currently, decideForKeys loops over the list of flags and calls decide for each, which in turn calls ups. So for decideForKeys, there is two calls per flag to UPS. This PR batches UPS calls when using decideForKeys.

Test plan

  • Existing tests are updated to work with the new change. New tests will be added for batching.

Issues

  • FSSDK-10763

…file` in decision logic.

🛠️ optimizely/user_profile.py -> Improved user profile loading with missing key checks.
🛠️ tests/test_decision_service.py -> Updated tests to include user profile tracker.
🛠️ tests/test_decision_service.py -> Updated experiment bucket map call.
🛠️ tests/test_decision_service.py -> Introduced user_profile_tracker usage.
🛠️ tests/test_decision_service.py -> Modified method calls with user_profile_tracker.
tests/test_decision_service.py -> Added user profile tracker object
tests/test_decision_service.py -> Fixed tests
Copy link
Contributor

@Mat001 Mat001 left a comment

Choose a reason for hiding this comment

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

Looks great! Just please cleanup old commented out pieces. Then we'll merge once done :)

optimizely/decision_service.py Outdated Show resolved Hide resolved
optimizely/optimizely.py Outdated Show resolved Hide resolved
optimizely/optimizely.py Outdated Show resolved Hide resolved
optimizely/optimizely.py Outdated Show resolved Hide resolved
optimizely/user_profile.py Outdated Show resolved Hide resolved
optimizely/user_profile.py Outdated Show resolved Hide resolved
tests/test_user_context.py Outdated Show resolved Hide resolved
optimizely/decision_service.py Outdated Show resolved Hide resolved
optimizely/optimizely.py Show resolved Hide resolved
optimizely/optimizely.py Show resolved Hide resolved
optimizely/optimizely.py -> Added loading and saving profile logic
optimizely/user_profile.py -> Testing user profile update logic
optimizely/user_profile.py -> Removed unused import statement
optimizely/user_profile.py -> Fixed handling of reasons list
optimizely/user_profile.py -> Improved profile retrieval error logging
tests/test_decision_service.py -> Updated mock checks to simplify tests
tests/test_user_profile.py -> Added tests for user profile handling
tests/test_optimizely.py -> New test for variation lookup and save
Copy link
Contributor

@Mat001 Mat001 left a comment

Choose a reason for hiding this comment

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

I think it looks ok to me!

Copy link

@raju-opti raju-opti left a comment

Choose a reason for hiding this comment

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

lgtm. two non critical comments

optimizely/user_profile.py Show resolved Hide resolved
optimizely/user_profile.py Show resolved Hide resolved
@FarhanAnjum-opti FarhanAnjum-opti merged commit 22c74ee into master Nov 27, 2024
23 checks passed
@FarhanAnjum-opti FarhanAnjum-opti deleted the farhan/FSSDK-10763-batch-UPS branch November 27, 2024 16:27
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.

3 participants