[AI-FSSDK] [FSSDK-12839] Normalize impression event campaign_id, variation_id, entity_id#519
Closed
jaeopt wants to merge 2 commits into
Closed
[AI-FSSDK] [FSSDK-12839] Normalize impression event campaign_id, variation_id, entity_id#519jaeopt wants to merge 2 commits into
jaeopt wants to merge 2 commits into
Conversation
Contributor
Author
|
redundant |
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.
Summary
Impression-event payloads emitted by the Python SDK can carry empty, null, or non-numeric values for
decisions[].campaign_id,decisions[].variation_id, andevents[].entity_id— most visibly on holdout decisions, which legitimately lack alayerId. Downstream event processing requires these fields to be numeric strings (or explicitnullforvariation_id), so malformed values are silently dropped or misattributed. This change normalizes those fields at the event-builder layer so every impression event conforms to the wire contract.Changes
is_numeric_string_idhelper that recognises a non-empty ASCII decimal-digit string as the only valid form for these IDs.decisions[].campaign_idto fall back to the decision'sexperiment_idwhen the source value is invalid, and normalizedecisions[].variation_idtoNonewhen invalid.events[].entity_idfrom the same normalized value ascampaign_idso the two fields are guaranteed byte-equal on every impression payload.entity_idfrom the conversion event's ownid.Jira Ticket
FSSDK-12839