Conversation
| log = logging.getLogger("posthog") | ||
|
|
||
| APP_ENDPOINT = "https://app.posthog.com" | ||
| APP_ENDPOINT = "https://us.posthog.com" |
There was a problem hiding this comment.
[P1] Default cloud host likely shouldn’t change from app.posthog.com to us.posthog.com.
Changing APP_ENDPOINT to https://us.posthog.com alters the default API base for anyone who previously relied on the implicit default (including EU Cloud users). If the intent is to fix the prompts API specifically, consider either keeping APP_ENDPOINT as app.posthog.com or deriving the prompts base from an existing canonical host constant used elsewhere in the SDK (or documenting that host must be set for non-US regions).
Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/ai/prompts.py
Line: 18:18
Comment:
[P1] Default cloud host likely shouldn’t change from `app.posthog.com` to `us.posthog.com`.
Changing `APP_ENDPOINT` to `https://us.posthog.com` alters the default API base for anyone who previously relied on the implicit default (including EU Cloud users). If the intent is to fix the *prompts* API specifically, consider either keeping `APP_ENDPOINT` as `app.posthog.com` or deriving the prompts base from an existing canonical host constant used elsewhere in the SDK (or documenting that `host` must be set for non-US regions).
How can I resolve this? If you propose a fix, please make it concise.| def create_mock_posthog( | ||
| self, personal_api_key="phx_test_key", host="https://app.posthog.com" | ||
| self, personal_api_key="phx_test_key", host="https://us.posthog.com" | ||
| ): |
There was a problem hiding this comment.
[P2] Test helper default host hard-codes US cloud.
create_mock_posthog(..., host="https://us.posthog.com") bakes a region-specific assumption into most tests, which makes it harder to catch regressions where host handling differs between regions / self-hosted. It’d be more robust to keep the default host aligned with the SDK default (or parameterize host in the specific assertions that care about it).
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: posthog/test/ai/test_prompts.py
Line: 35:37
Comment:
[P2] Test helper default host hard-codes US cloud.
`create_mock_posthog(..., host="https://us.posthog.com")` bakes a region-specific assumption into most tests, which makes it harder to catch regressions where `host` handling differs between regions / self-hosted. It’d be more robust to keep the default host aligned with the SDK default (or parameterize host in the specific assertions that care about it).
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
posthog-python Compliance ReportDate: 2026-02-04 15:10:17 UTC
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 516ms |
| Format Validation.Event Has Uuid | ✅ | 1506ms |
| Format Validation.Event Has Lib Properties | ✅ | 1506ms |
| Format Validation.Distinct Id Is String | ✅ | 1506ms |
| Format Validation.Token Is Present | ✅ | 1506ms |
| Format Validation.Custom Properties Preserved | ✅ | 1506ms |
| Format Validation.Event Has Timestamp | ✅ | 1506ms |
| Retry Behavior.Retries On 503 | ✅ | 7739ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 3509ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 3507ms |
| Retry Behavior.Respects Retry After Header | ❌ | 6600ms |
| Retry Behavior.Implements Backoff | ✅ | 21409ms |
| Retry Behavior.Retries On 500 | ✅ | 6959ms |
| Retry Behavior.Retries On 502 | ✅ | 7406ms |
| Retry Behavior.Retries On 504 | ✅ | 7277ms |
| Retry Behavior.Max Retries Respected | ✅ | 18340ms |
| Deduplication.Generates Unique Uuids | ✅ | 1497ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 7419ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 13611ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 6912ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 1502ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 1506ms |
| Compression.Sends Gzip When Enabled | ✅ | 1506ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 1506ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 1004ms |
| Batch Format.Multiple Events Batched Together | ✅ | 1505ms |
| Error Handling.Does Not Retry On 403 | ✅ | 3507ms |
| Error Handling.Does Not Retry On 413 | ✅ | 3506ms |
| Error Handling.Retries On 408 | ❌ | 6510ms |
Failures
retry_behavior.respects_retry_after_header
Retry delay too short: 91ms < 2500ms
error_handling.retries_on_408
Expected at least 2 requests, got 1
No description provided.