Skip to content

Commit f1345ac

Browse files
committed
tweak
1 parent 501a111 commit f1345ac

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"distinct_id_random_22", person_properties={"$geoip_city_name": "Sydney"}, only_evaluate_locally=True
102102
)
103103
)
104-
print(posthog.get_decrypted_feature_flag_payload("encrypted_payload_flag_key"))
104+
print(posthog.get_remote_config_payload("encrypted_payload_flag_key"))
105105

106106

107107
posthog.shutdown()

posthog/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,22 +492,22 @@ def get_feature_flag_payload(
492492
)
493493

494494

495-
def get_decrypted_feature_flag_payload(
495+
def get_remote_config_payload(
496496
key, # type: str
497497
):
498-
"""Get the decrypted payload for a specific feature flag.
498+
"""Get the payload for a remote config feature flag.
499499
500500
Args:
501501
key: The key of the feature flag
502502
503503
Returns:
504-
The decrypted payload associated with the feature flag
504+
The payload associated with the feature flag. If payload is encrypted, the return value will decrypted
505505
506506
Note:
507507
Requires personal_api_key to be set for authentication
508508
"""
509509
return _proxy(
510-
"get_decrypted_feature_flag_payload",
510+
"get_remote_config_payload",
511511
key=key,
512512
)
513513

posthog/client.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,6 @@ def get_decide(self, distinct_id, groups=None, person_properties=None, group_pro
212212

213213
return resp_data
214214

215-
def get_remote_config_payload(self, key: str):
216-
resp_data = remote_config(
217-
self.personal_api_key,
218-
self.host,
219-
key,
220-
timeout=self.feature_flags_request_timeout_seconds,
221-
)
222-
223-
return resp_data
224-
225215
def capture(
226216
self,
227217
distinct_id=None,
@@ -859,7 +849,7 @@ def get_feature_flag_payload(
859849

860850
return payload
861851

862-
def get_decrypted_feature_flag_payload(self, key: str):
852+
def get_remote_config_payload(self, key: str):
863853
if self.disabled:
864854
return None
865855

@@ -870,7 +860,12 @@ def get_decrypted_feature_flag_payload(self, key: str):
870860
return None
871861

872862
try:
873-
return self.get_remote_config_payload(key)
863+
return remote_config(
864+
self.personal_api_key,
865+
self.host,
866+
key,
867+
timeout=self.feature_flags_request_timeout_seconds,
868+
)
874869
except Exception as e:
875870
self.log.exception(f"[FEATURE FLAGS] Unable to get decrypted feature flag payload: {e}")
876871

0 commit comments

Comments
 (0)