Skip to content

Commit 72a8b47

Browse files
authored
chore: remove unused decide helper and stale references (#503)
* chore: remove unused decide helper and stale references * style: format test_request with ruff
1 parent 7c83f2b commit 72a8b47

5 files changed

Lines changed: 74 additions & 83 deletions

File tree

posthog/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def get_feature_variants(
390390
device_id: Optional[str] = None,
391391
) -> dict[str, Union[bool, str]]:
392392
"""
393-
Get feature flag variants for a user by calling decide.
393+
Get feature flag variants for a user.
394394
395395
Args:
396396
distinct_id: The distinct ID of the user.
@@ -427,7 +427,7 @@ def get_feature_payloads(
427427
device_id: Optional[str] = None,
428428
) -> dict[str, str]:
429429
"""
430-
Get feature flag payloads for a user by calling decide.
430+
Get feature flag payloads for a user.
431431
432432
Args:
433433
distinct_id: The distinct ID of the user.
@@ -469,7 +469,7 @@ def get_feature_flags_and_payloads(
469469
device_id: Optional[str] = None,
470470
) -> FlagsAndPayloads:
471471
"""
472-
Get feature flags and payloads for a user by calling decide.
472+
Get feature flags and payloads for a user.
473473
474474
Args:
475475
distinct_id: The distinct ID of the user.

posthog/request.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def init_poolmanager(self, *args, **kwargs):
7373

7474

7575
def _build_session(socket_options: Optional[SocketOptions] = None) -> requests.Session:
76-
"""Build a session for general requests (batch, decide, etc.)."""
76+
"""Build a session for general requests (batch, remote config, etc.)."""
7777
adapter = HTTPAdapterWithSocketOptions(
7878
max_retries=Retry(
7979
total=2,
@@ -221,7 +221,7 @@ def _process_response(
221221
if res.status_code == 200:
222222
log.debug(success_message)
223223
response = res.json() if return_json else res
224-
# Handle quota limited decide responses by raising a specific error
224+
# Handle quota-limited feature flag responses by raising a specific error
225225
# NB: other services also put entries into the quotaLimited key, but right now we only care about feature flags
226226
# since most of the other services handle quota limiting in other places in the application.
227227
if (
@@ -262,18 +262,6 @@ def _process_response(
262262
raise APIError(res.status_code, res.text, retry_after=retry_after)
263263

264264

265-
def decide(
266-
api_key: str,
267-
host: Optional[str] = None,
268-
gzip: bool = False,
269-
timeout: int = 15,
270-
**kwargs,
271-
) -> Any:
272-
"""Post the `kwargs to the decide API endpoint"""
273-
res = post(api_key, host, "/decide/?v=4", gzip, timeout, **kwargs)
274-
return _process_response(res, success_message="Feature flags decided successfully")
275-
276-
277265
def flags(
278266
api_key: str,
279267
host: Optional[str] = None,

0 commit comments

Comments
 (0)