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

feat: python local evaluation implementation #52

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 0 additions & 33 deletions .github/workflows/test-arm.yml

This file was deleted.

1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
parameterized~=0.9.0
python-dotenv~=0.21.1
requests~=2.31.0
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
amplitude_analytics~=1.1.1
amplitude_analytics~=1.1.1
dataclasses-json~=0.6.7
10 changes: 5 additions & 5 deletions src/amplitude_experiment/deployment/deployment_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ def __update_flag_configs(self):
self.logger.warning(f'Failed to fetch flag configs: {e}')
raise e

flag_keys = {flag['key'] for flag in flag_configs}
self.flag_config_storage.remove_if(lambda f: f['key'] not in flag_keys)
flag_keys = {flag.key for flag in flag_configs}
self.flag_config_storage.remove_if(lambda f: f.key not in flag_keys)

if not self.cohort_loader:
for flag_config in flag_configs:
self.logger.debug(f"Putting non-cohort flag {flag_config['key']}")
self.logger.debug(f"Putting non-cohort flag {flag_config.key}")
self.flag_config_storage.put_flag_config(flag_config)
return

Expand All @@ -83,11 +83,11 @@ def __update_flag_configs(self):
# iterate through new flag configs and check if their required cohorts exist
for flag_config in flag_configs:
cohort_ids = get_all_cohort_ids_from_flag(flag_config)
self.logger.debug(f"Storing flag {flag_config['key']}")
self.logger.debug(f"Storing flag {flag_config.key}")
self.flag_config_storage.put_flag_config(flag_config)
missing_cohorts = cohort_ids - updated_cohort_ids
if missing_cohorts:
self.logger.warning(f"Flag {flag_config['key']} - failed to load cohorts: {missing_cohorts}")
self.logger.warning(f"Flag {flag_config.key} - failed to load cohorts: {missing_cohorts}")

# delete unused cohorts
self._delete_unused_cohorts()
Expand Down
Empty file.
Loading
Loading