Skip to content

[FSSDK-11458] Python - Add SDK Multi-Region Support for Data Hosting #459

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

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix lint issues
  • Loading branch information
esrakartalOpt committed Jul 2, 2025
commit 08669627c058d2e59f29582863b9958e74af851f
12 changes: 10 additions & 2 deletions optimizely/event/user_event_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ def create_impression_event(
variation = project_config.get_variation_from_id_by_experiment_id(experiment_id, variation_id)

event_context = user_event.EventContext(
project_config.account_id, project_config.project_id, project_config.revision, project_config.anonymize_ip, project_config.region
project_config.account_id,
project_config.project_id,
project_config.revision,
project_config.anonymize_ip,
project_config.region
)

return user_event.ImpressionEvent(
Expand Down Expand Up @@ -115,7 +119,11 @@ def create_conversion_event(
"""

event_context = user_event.EventContext(
project_config.account_id, project_config.project_id, project_config.revision, project_config.anonymize_ip, project_config.region
project_config.account_id,
project_config.project_id,
project_config.revision,
project_config.anonymize_ip,
project_config.region
)

return user_event.ConversionEvent(
Expand Down
3 changes: 0 additions & 3 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def test_region_when_no_region(self):
project_config = opt_obj.config_manager.get_config()
self.assertEqual(project_config.region, Region.US)


def test_region_when_specified_in_datafile(self):
""" Test that region is set to 'US' when specified in the config. """
config_dict_us = copy.deepcopy(self.config_dict_with_multiple_experiments)
Expand All @@ -177,8 +176,6 @@ def test_region_when_specified_in_datafile(self):
project_config_eu = opt_obj_eu.config_manager.get_config()
self.assertEqual(project_config_eu.region, Region.EU)



def test_cmab_field_population(self):
""" Test that the cmab field is populated correctly in experiments."""

Expand Down