This repository was archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Randomization Assignment Function #2
Merged
Merged
Conversation
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
ploomiz
commented
Apr 30, 2022
petzel
approved these changes
May 2, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment on naming. Assignment logic and tests LGTM.
shard = get_shard( | ||
"assignment-{}-{}".format(subject, flag), experiment_config.subjectShards | ||
) | ||
return next( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
ploomiz
commented
May 3, 2022
from pydantic import BaseModel | ||
|
||
|
||
def to_camel(s: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this in response to #2 (comment)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
labels: mergeable
Fixes: #issue
#2907
Motivation and Context
The randomization assignment function is used for assigning subjects to variations. It is described in detail in this design doc.
Description
This PR implements the same assignment logic as in the Node SDK.
How has this been tested?
It's important that the Python and Node SDK implementations produce the same assignment results. To make sure the implementations are consistent, we use shared test data stored in a google cloud storage bucket. Before the test starts, the test data is downloaded from GCP and written to a local directory.
The test data includes an
expectedAssignments
field which is the source of truth in that all SDK tests (iOS, Ruby, etc.) should verify these assignments are generated for thesubjects
input. How do we know theexpectedAssignments
are correct? Before uploading test data to the storage bucket, verify thatexpectedAssignments
have an even variation split; each variation should have roughly the same number of assignments.