Skip to content

chore: remove unused decide helper and stale references#503

Open
marandaneto wants to merge 2 commits intomasterfrom
chore/remove-unused-decide-helper
Open

chore: remove unused decide helper and stale references#503
marandaneto wants to merge 2 commits intomasterfrom
chore/remove-unused-decide-helper

Conversation

@marandaneto
Copy link
Copy Markdown
Member

@marandaneto marandaneto commented Apr 13, 2026

Problem

The Python SDK no longer uses the legacy /decide helper for feature flag evaluation, but a dead helper and several stale comments/docstrings still referred to it. This made the code and tests misleading.

Changes

  • remove the unused decide() helper from posthog/request.py
  • update feature flag docstrings and response-normalization docs to refer to /flags
  • update request tests to exercise flags() instead of the removed helper
  • rename stale /decide comments and fixture values in feature flag tests where they now describe /flags fallback
  • format posthog/test/test_request.py with Ruff

Checklist

  • Tests added/updated where relevant
  • Verified locally (uv run pytest posthog/test/test_request.py posthog/test/test_types.py -q, uv run pytest posthog/test/test_feature_flags.py -q, and uvx ruff format --check .)
  • Changeset added
  • Release label added

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?

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 13, 2026

Reviews (1): Last reviewed commit: "chore: remove unused decide helper and s..." | Re-trigger Greptile

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

posthog-python Compliance Report

Date: 2026-04-13 10:39:10 UTC
Duration: 159481ms

✅ All Tests Passed!

29/29 tests passed


Capture Tests

29/29 tests passed

View Details
Test Status Duration
Format Validation.Event Has Required Fields 517ms
Format Validation.Event Has Uuid 1507ms
Format Validation.Event Has Lib Properties 1506ms
Format Validation.Distinct Id Is String 1507ms
Format Validation.Token Is Present 1507ms
Format Validation.Custom Properties Preserved 1507ms
Format Validation.Event Has Timestamp 1507ms
Retry Behavior.Retries On 503 9513ms
Retry Behavior.Does Not Retry On 400 3510ms
Retry Behavior.Does Not Retry On 401 3508ms
Retry Behavior.Respects Retry After Header 9509ms
Retry Behavior.Implements Backoff 23521ms
Retry Behavior.Retries On 500 7515ms
Retry Behavior.Retries On 502 7510ms
Retry Behavior.Retries On 504 7512ms
Retry Behavior.Max Retries Respected 23519ms
Deduplication.Generates Unique Uuids 1508ms
Deduplication.Preserves Uuid On Retry 7511ms
Deduplication.Preserves Uuid And Timestamp On Retry 14524ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry 7507ms
Deduplication.No Duplicate Events In Batch 1504ms
Deduplication.Different Events Have Different Uuids 1508ms
Compression.Sends Gzip When Enabled 1506ms
Batch Format.Uses Proper Batch Structure 1507ms
Batch Format.Flush With No Events Sends Nothing 1005ms
Batch Format.Multiple Events Batched Together 1505ms
Error Handling.Does Not Retry On 403 3509ms
Error Handling.Does Not Retry On 413 3507ms
Error Handling.Retries On 408 7514ms

@github-project-automation github-project-automation bot moved this from In Review to Approved in Feature Flags Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved

Development

Successfully merging this pull request may close these issues.

2 participants