Run split tests with less friction directly in Python.
session
object provided to the client.
pip install winningvariant
winningvariant
package.
session
object:
Parameter | Description |
---|---|
session | The snowflake.snowpark session to use to access the Winning Variant Snowflake Native App. |
cache | (Default: True ) If True , enables local caching of assignments as they’re read/created. |
session
must have one of the following application roles:admin
editor
scientist
wv.enable_cache()
or wv.disable_cache()
, respectively.
Assignment
object that is used to identify the ID of a variant that a subject is assigned within an experiment. Read more here.
The Assignment object includes a reference to the subject_id
, experiment_id
, and the variant
it’s assigned to.
is_variant("<Variant>")
or do a string comparison:
Parameter | Description | Type |
---|---|---|
subject_id | (Required) ID of the subject used in the experiment. | string |
experiment_id | (Required) ID of the experiment. | string |
None
.
Parameter | Description | Type |
---|---|---|
subject_id | (Required) ID of the subject used in the experiment. | string |
experiment_id | (Required) ID of the experiment. | string |
None
if something went wrong.
check_variant
function. A good use case for this would be in 2-variant A/B tests or feature flag scenarios where you want to quickly check if a subject is in the treatment group.
Parameter | Description | Type |
---|---|---|
subject_id | (Required) ID of the subject used in the experiment. | string |
experiment_id | (Required) ID of the experiment. | string |
variant_id | (**Required) **ID of the variant to check. | string |
create_assignment | (Default: True) If set, an assignment wll be made if one doesn’t already exist. | bool |
subject_id
OR subject_arg
that specifes the argument passed to the function that will include the subject ID.experiment_id
OR experiment_arg
that specifies the argument passed to the function that will include the experiment ID.@<client>.assignment
@<client>.if_assignment
Parameter | Description | Type |
---|---|---|
variant_id | (Required) The ID of the variant to compare against. | string |
create_assignment | (Default: True) If True, creates an assignment if one doesn’t exist. | bool |
@<client>.unless_assignment
Parameter | Description | Type |
---|---|---|
variant_id | (Required) The ID of the variant to compare against. | string |
create_assignment | (Default: True) If True, creates an assignment if one doesn’t exist. | bool |