Repository navigation
Support custom Decider context and identifier fields - #128
Draft
tim-zhu-reddit wants to merge 5 commits into
Draft
tim-zhu-reddit wants to merge 5 commits into
tim-zhu-reddit wants to merge 5 commits into
Conversation
mrlevitas
approved these changes
Oct 22, 2026
Comment on lines
+500
to
+521
| if identifier_type not in IDENTIFIERS: | ||
| logger.warning( | ||
| f'"{identifier_type}" is not one of supported "identifier_type": {IDENTIFIERS}.' | ||
| ) | ||
| ctx = self._context_for_identifier(identifier, identifier_type) |
Contributor
There was a problem hiding this comment.
ah nice! That works great for removing identifier_type restriction for get_variant_for_identifier API.
We may also want to consider expanding the standard get_variant API to take Optional **context_kwargs (similar to **exposure_kwargs) for populating arbitrary fields under other_info dict for the same flexibility as Native-Go Decider.
Since it's optional field, should be backwards compatible.
Contributor
Author
There was a problem hiding this comment.
added in 0bff712
get_variantandget_variant_without_exposetake an optional keyword-onlycontext_fieldsdict (python can't have a second**kwargsnext to**exposure_kwargs)- fields apply to that call only, at the top level and under
other_fields, and win over the stored context - exposures still log the stored fields plus the bucketing value, same as the identifier APIs
kept it to those two for now. happy to add it to get_all_variants_without_expose and the dynamic config getters too if you want full Native-Go Decider parity
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.
💸 TL;DR
📜 Details
IDENTIFIERSlist; accept custom names in all three identifier APIs.context_fieldstoget_variantandget_variant_without_expose.inputswithout colliding with logger metadata orself.🧪 Testing Steps / Validation
context_fieldstests fail before the change and pass afterward.make lintpasses for Python 3.8, 3.9, and 3.10;git diff --checkpasses; context isolation verified.0bff712.✅ Checks