Skip to content
Merged
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
6 changes: 3 additions & 3 deletions posthog/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def get_feature_variants(
device_id: Optional[str] = None,
) -> dict[str, Union[bool, str]]:
"""
Get feature flag variants for a user by calling decide.
Get feature flag variants for a user.

Args:
distinct_id: The distinct ID of the user.
Expand Down Expand Up @@ -427,7 +427,7 @@ def get_feature_payloads(
device_id: Optional[str] = None,
) -> dict[str, str]:
"""
Get feature flag payloads for a user by calling decide.
Get feature flag payloads for a user.

Args:
distinct_id: The distinct ID of the user.
Expand Down Expand Up @@ -469,7 +469,7 @@ def get_feature_flags_and_payloads(
device_id: Optional[str] = None,
) -> FlagsAndPayloads:
"""
Get feature flags and payloads for a user by calling decide.
Get feature flags and payloads for a user.

Args:
distinct_id: The distinct ID of the user.
Expand Down
16 changes: 2 additions & 14 deletions posthog/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def init_poolmanager(self, *args, **kwargs):


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


def decide(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this wasnt being called anywhere anymore so i assume its left over?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PostHog/team-feature-flags can you confirm before i pull the plug?

api_key: str,
host: Optional[str] = None,
gzip: bool = False,
timeout: int = 15,
**kwargs,
) -> Any:
"""Post the `kwargs to the decide API endpoint"""
res = post(api_key, host, "/decide/?v=4", gzip, timeout, **kwargs)
return _process_response(res, success_message="Feature flags decided successfully")


def flags(
api_key: str,
host: Optional[str] = None,
Expand Down
Loading
Loading