feat: add with_metadata option to Prompts.get()#510
Merged
carlos-marchal-ph merged 3 commits intomasterfrom Apr 15, 2026
Merged
feat: add with_metadata option to Prompts.get()#510carlos-marchal-ph merged 3 commits intomasterfrom
carlos-marchal-ph merged 3 commits intomasterfrom
Conversation
Contributor
posthog-python Compliance ReportDate: 2026-04-15 15:33:16 UTC
|
| Test | Status | Duration |
|---|---|---|
| Format Validation.Event Has Required Fields | ✅ | 517ms |
| Format Validation.Event Has Uuid | ✅ | 1508ms |
| Format Validation.Event Has Lib Properties | ✅ | 1507ms |
| Format Validation.Distinct Id Is String | ✅ | 1507ms |
| Format Validation.Token Is Present | ✅ | 1509ms |
| Format Validation.Custom Properties Preserved | ✅ | 1507ms |
| Format Validation.Event Has Timestamp | ✅ | 1507ms |
| Retry Behavior.Retries On 503 | ✅ | 9515ms |
| Retry Behavior.Does Not Retry On 400 | ✅ | 3511ms |
| Retry Behavior.Does Not Retry On 401 | ✅ | 3507ms |
| Retry Behavior.Respects Retry After Header | ✅ | 9515ms |
| Retry Behavior.Implements Backoff | ✅ | 23530ms |
| Retry Behavior.Retries On 500 | ✅ | 7501ms |
| Retry Behavior.Retries On 502 | ✅ | 7517ms |
| Retry Behavior.Retries On 504 | ✅ | 7508ms |
| Retry Behavior.Max Retries Respected | ✅ | 23535ms |
| Deduplication.Generates Unique Uuids | ✅ | 1497ms |
| Deduplication.Preserves Uuid On Retry | ✅ | 7512ms |
| Deduplication.Preserves Uuid And Timestamp On Retry | ✅ | 14519ms |
| Deduplication.Preserves Uuid And Timestamp On Batch Retry | ✅ | 7511ms |
| Deduplication.No Duplicate Events In Batch | ✅ | 1508ms |
| Deduplication.Different Events Have Different Uuids | ✅ | 1508ms |
| Compression.Sends Gzip When Enabled | ✅ | 1508ms |
| Batch Format.Uses Proper Batch Structure | ✅ | 1507ms |
| Batch Format.Flush With No Events Sends Nothing | ✅ | 1006ms |
| Batch Format.Multiple Events Batched Together | ✅ | 1506ms |
| Error Handling.Does Not Retry On 403 | ✅ | 3508ms |
| Error Handling.Does Not Retry On 413 | ✅ | 3509ms |
| Error Handling.Retries On 408 | ✅ | 7510ms |
Feature_Flags Tests
View Details
| Test | Status | Duration |
|---|---|---|
| Request Payload.Request With Person Properties Device Id | ❌ | 505ms |
Failures
request_payload.request_with_person_properties_device_id
404, message='NOT FOUND', url='http://sdk-adapter:8080/get_feature_flag'
Contributor
|
richardsolomou
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Motivation and Context
Port of PostHog/posthog-js#3387 to Python.
Prompts.get()returns only the prompt string, discardingnameandversionfrom the API response. Users want to track$ai_prompt_name/$ai_prompt_versionon AI generation events without a separate HTTP call.Adds a
with_metadataoption toget(). WhenTrue, returns aPromptResultdataclass withsource(api,cache,stale_cache, orcode_fallback),name, andversion. Deprecates callingget()withoutwith_metadata(warns once per instance viaDeprecationWarning).💚 How did you test it?
📝 Checklist
If releasing new changes
sampo addto generate a changeset filereleaselabel to the PR