Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: optimizely/python-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5.0.0
Choose a base ref
...
head repository: optimizely/python-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 20 commits
  • 46 files changed
  • 6 contributors

Commits on Feb 8, 2024

  1. build(deps): bump flask from 1.1.2 to 2.2.5 in /tests/testapp (#432)

    * build(deps): bump flask from 1.1.2 to 2.2.5 in /tests/testapp
    
    Bumps [flask](https://github.com/pallets/flask) from 1.1.2 to 2.2.5.
    - [Release notes](https://github.com/pallets/flask/releases)
    - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst)
    - [Commits](pallets/flask@1.1.2...2.2.5)
    
    ---
    updated-dependencies:
    - dependency-name: flask
      dependency-type: direct:production
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    * update to py 3 in dockerfile
    
    ---------
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Matjaz Pirnovar <Mat001@users.noreply.github.com>
    dependabot[bot] and Mat001 authored Feb 8, 2024
    Configuration menu
    Copy the full SHA
    3d1a21c View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Mpirnovar update error (#433)

    * updare error log message
    
    * test for the log message
    
    * upate to generic exception
    Mat001 authored Mar 12, 2024
    Configuration menu
    Copy the full SHA
    2f00b4d View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2024

  1. Configuration menu
    Copy the full SHA
    5caf9a5 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2024

  1. Configuration menu
    Copy the full SHA
    144e41f View commit details
    Browse the repository at this point in the history
  2. changelog, version (#437)

    Mat001 authored Jun 26, 2024
    Configuration menu
    Copy the full SHA
    986e615 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2024

  1. Configuration menu
    Copy the full SHA
    40880ff View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2024

  1. [FSSDK-10763] Implement UPS request batching for decideForKeys (#440)

    * update: UserProfile class created, changes in decision_service, decide_for_keys
    
    * update: get_variation function changed
    
    * update: new function in decision_service
    
    * update: everything implemented from java. tests are failing
    
    * update: minor changes
    
    * update: user_profile_tracker added to tests
    
    * update: some tests fixed
    
    * optimizely/decision_service.py -> Added check for `ignore_user_profile` 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 -> Added expected decision object.
    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.
    
    * optimizely/decision_service.py -> fixed get_variations_for_feature_list
    
    * optimizely/decision_service.py -> Fixed how rollout reasons are added
    tests/test_decision_service.py -> Added user profile tracker object
    
    * tests/test_user_context.py -> fixed some tests
    
    * optimizely/user_profile.py -> Updated type for `experiment_bucket_map`.
    tests/test_decision_service.py -> Fixed tests
    
    * all unit tests passing
    
    * lint check
    
    * fix: typechecks added
    
    * more types updated
    
    * all typechecks passing
    
    * gha typechecks fixed
    
    * all typecheck should pass
    
    * lint check should pass
    
    * removed unnecessary comments
    
    * removed comments from test
    
    * optimizely/decision_service.py -> Removed user profile save logic
    optimizely/optimizely.py -> Added loading and saving profile logic
    
    * optimizely/user_profile.py -> Updated experiment_bucket_map type
    optimizely/user_profile.py -> Testing user profile update logic
    
    * optimizely/decision_service.py -> Commented out profile loading
    optimizely/user_profile.py -> Removed unused import statement
    
    * optimizely/decision_service.py -> Removed unused profile loading
    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
    
    * optimizely/user_profile.py -> Reverted back to variation ID retrieval logic.
    
    * optimizely/user_profile.py -> Added error handling logic
    FarhanAnjum-opti authored Nov 27, 2024
    Configuration menu
    Copy the full SHA
    22c74ee View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2024

  1. Configuration menu
    Copy the full SHA
    7fa6153 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2024

  1. Configuration menu
    Copy the full SHA
    45e73bb View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2025

  1. [FSSDK-11212] Update code to retry web API calls for fetching datafil…

    …e and pushing events (#445)
    
    * Update code to retry web API calls for fetching datafile and pushing events
    
    * Fix linting issues
    
    * Remove print statements
    
    * Fix up 'retries' member
    
    * Stub out requests.Session.get instead of requests.get
    
    * Update tests
    
    * Fix mypy error and linting error
    
    * Update for tests
    
    * Update
    
    * Update optimizely/event_dispatcher.py
    
    Co-authored-by: Jae Kim <45045038+jaeopt@users.noreply.github.com>
    
    * Update event dispatch to try three times to send events
    
    * Update changelog and version number
    
    * Update version number
    
    * Remove changelog and version update
    
    ---------
    
    Co-authored-by: Paul V Craven <paul.craven@optimizley.com>
    Co-authored-by: Jae Kim <45045038+jaeopt@users.noreply.github.com>
    3 people authored Feb 26, 2025
    Configuration menu
    Copy the full SHA
    d098f9a View commit details
    Browse the repository at this point in the history
  2. Add changelog and update version number (#446)

    Co-authored-by: Paul V Craven <paul.craven@optimizley.com>
    pvcraven and Paul V Craven authored Feb 26, 2025
    Configuration menu
    Copy the full SHA
    55bc008 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2025

  1. [FSSDK-11362] Fix CSRF security warning (#448)

    * Fix CSRF security warning
    
    * Ignore linting error
    
    * Ignore flake8 warning
    
    ---------
    
    Co-authored-by: Paul V Craven <paul.craven@optimizley.com>
    pvcraven and Paul V Craven authored Apr 24, 2025
    Configuration menu
    Copy the full SHA
    8062f54 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2025

  1. Import CSRFProtect from a better spot so prisma picks it up (#450)

    Co-authored-by: Paul V Craven <paul.craven@optimizley.com>
    pvcraven and Paul V Craven authored Apr 25, 2025
    Configuration menu
    Copy the full SHA
    f8da261 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2025

  1. [FSSDK-11139] update: enable project config to track CMAB properties (#…

    …451)
    
    * Add CmabDict type and update Experiment class to include cmab field
    
    * Refactor ProjectConfig to add attribute ID to key mapping and implement retrieval methods; update test for cmab field population
    FarhanAnjum-opti authored May 5, 2025
    Configuration menu
    Copy the full SHA
    5f71922 View commit details
    Browse the repository at this point in the history

Commits on May 7, 2025

  1. Try 3 to fix csrf scan issue (#452)

    Co-authored-by: Paul V Craven <paul.craven@optimizley.com>
    pvcraven and Paul V Craven authored May 7, 2025
    Configuration menu
    Copy the full SHA
    fd0930c View commit details
    Browse the repository at this point in the history

Commits on May 16, 2025

  1. [FSSDK-11017] update: experiment_id and variation_id added to payloads (

    #447)
    
    * experiment_id and variation_id added to payloads
    
    * optimizely/optimizely.py -> Removed experiment_id and variation_id from legacy apis.
    optimizely/project_config.py -> Enhanced comments for clarity.
    tests/test_user_context.py -> Updated test assertions for experiments.
    
    * .flake8 -> redundant checks being performed in tests/testapp/application.py so added it to exclusions
    
    * reverting to previous code
    
    * change in logic to get experiment_id by key or rollout_id
    
    * update project_config.py
    
    * fetching experiment_id and variation_id from flag_decision
    
    * -updated experiment_id and variation_id fetching logic
    -removed redundant function from project_config.py
    
    * chore: trigger workflow
    FarhanAnjum-opti authored May 16, 2025
    Configuration menu
    Copy the full SHA
    47e7b4f View commit details
    Browse the repository at this point in the history

Commits on May 20, 2025

  1. [FSSDK-11157] update: added remove method in LRU Cache for CMAB servi…

    …ce (#454)
    
    * Add remove method and tests in LRUCache for cmab service
    
    * refactor: simplify remove method in LRUCache and update related tests
    
    * refactor: remove redundant assertion in test_remove_existing_key
    FarhanAnjum-opti authored May 20, 2025
    Configuration menu
    Copy the full SHA
    72048b6 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2025

  1. [FSSDK-11148] update: Implement CMAB Client (#453)

    * Implement CMAB client with retry logic for fetching predictions
    
    * Enhance CMAB client error handling and logging; add unit tests for fetch methods
    
    * Refactor CMAB client: enhance docstrings for classes and methods, improve formatting, and clean up imports
    
    * Add custom exceptions for CMAB client errors and enhance error handling in fetch methods
    
    * Update fetch_decision method to set default timeout value to 10 seconds
    
    * replace constant endpoint with formatted string in fetch_decision method
    
    * chore: trigger CI
    
    * refactor: streamline fetch_decision method and enhance test cases for improved clarity and functionality
    FarhanAnjum-opti authored May 23, 2025
    Configuration menu
    Copy the full SHA
    046d457 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2025

  1. [FSSDK-11166] update: implement CMAB service (#455)

    * update: Implement DefaultCmabService
    
    * update: Add tests for DefaultCmabService
    
    * update: Fix formatting in DefaultCmabService and test cases
    
    * update: Fix key mapping in ProjectConfig to use 'id' instead of empty string
    
    * update: Refactor cache decision logic and enhance test cases for DefaultCmabService
    
    * update: Refactor attribute handling in get_decision and add test for CMAB attribute filtering
    FarhanAnjum-opti authored May 27, 2025
    Configuration menu
    Copy the full SHA
    82ec019 View commit details
    Browse the repository at this point in the history

Commits on Jul 7, 2025

  1. [FSSDK-11175] Update: Implement Decision Service methods to handle CM…

    …AB (#457)
    
    * update: integrate CMAB components into OptimizelyFactory
    
    * update: add cmab_service parameter to Optimizely constructor for CMAB support
    
    * update: add docstring to DefaultCmabService class for improved documentation
    
    * update: implement CMAB support in bucketer and decision service, revert OptimizelyFactory
    
    * linting fix
    
    * update: add cmab_uuid handling in DecisionService and related tests
    
    * - updated function bucket_to_entity_id
    - test_optimizely.py fixed to expect new Decision objects
    
    * update: add None parameter to Decision constructor in user context tests
    
    * update: enhance CMAB decision handling and add related tests
    
    * update: fix logger message formatting in CMAB experiment tests
    
    * mypy fix
    
    * update: refine traffic allocation type hints and key naming in bucketer and decision service
    
    * update: remove unused import of cast in bucketer.py
    
    * update: fix return type for numeric_metric_value in get_numeric_value and ensure key is of bytes type in hash128
    
    * update: specify type hint for numeric_metric_value in get_numeric_value function
    
    * update: fix logger reference in DefaultCmabClient initialization and add __init__.py for cmab module
    
    * update: enhance error logging for CMAB fetch failures with detailed messages and add a test for handling 500 errors
    
    * update: enhance decision result handling by introducing VariationResult and updating get_variation return type to include detailed error information
    
    * update: refactor get_variation return structure and change tests accordingly
    
    * -Error propagated to optimizely.py
    -test cases changed to handle return type dicts of DecisionResult and VariationResult
    
    * update: modify get_variation to return VariationResult and adjust related logic for improved variation handling
    
    * update: unit test fixes
    
    * Revert "update: unit test fixes"
    
    This reverts commit d2fc631.
    
    * Revert "update: modify get_variation to return VariationResult and adjust related logic for improved variation handling"
    
    This reverts commit b901c5f.
    
    * update: enhance decision service to handle error states and improve bucketing logic
    
    * update: remove debug print statement from Optimizely class
    
    * update: enhance bucketing logic to support CMAB traffic allocations
    
    * update: improve error logging for CMAB decision fetch failures
    
    * update: improve logging and error handling in bucketer and decision service
    FarhanAnjum-opti authored Jul 7, 2025
    Configuration menu
    Copy the full SHA
    81f5be9 View commit details
    Browse the repository at this point in the history
Loading