8000 feat: add odp config by andrewleap-optimizely · Pull Request #401 · optimizely/python-sdk · GitHub
[go: up one dir, main page]

Skip to content

feat: add odp config #401

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

Merged
merged 7 commits into from
Aug 22, 2022
Merged
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
address comments
  • Loading branch information
andrewleap-optimizely committed Aug 19, 2022
commit 49c0c7cbf2a98616b31a3bd4cc4ebcc4e0195254
10 changes: 5 additions & 5 deletions optimizely/odp/odp_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class OdpConfig:
Args:
api_host: The host URL for the ODP audience segments API (optional).
api_key: The public API key for the ODP account from which the audience segments will be fetched (optional).
segments_to_check: An array of all ODP segments used in the current datafile
segments_to_check: A list of all ODP segments used in the current datafile
(associated with api_host/api_key).
"""
def __init__(
Expand All @@ -45,7 +45,7 @@ def update(self, api_key: Optional[str], api_host: Optional[str], segments_to_ch
Args:
api_host: The host URL for the ODP audience segments API (optional).
api_key: The public API key for the ODP account from which the audience segments will be fetched (optional).
segments_to_check: An array of all ODP segments used in the current datafile
segments_to_check: A list of all ODP segments used in the current datafile
(associated with api_host/api_key).

Returns:
Expand Down Expand Up @@ -83,14 +83,14 @@ def get_segments_to_check(self) -> Optional[list[str]]:

def set_segments_to_check(self, segments_to_check: list[str]) -> None:
"""
Replace qualified segments with provided list of segments
Replace qualified segments with provided list of segments.
Args:
segments_to_check: A list of segment names
segments_to_check: A list of segment names.
"""
with self.lock:
self.segments_to_check = segments_to_check.copy()

def odp_integrated(self) -> bool:
"""Returns True if ODP is integrated"""
"""Returns True if ODP is integrated."""
with self.lock:
return self.api_key is not None and self.api_host is not None
0