Skip to content

Custom setting

CustomSetting #

CustomSetting(
    key: str,
    value: str,
    target: FeatureFlagTarget = "rapids",
)

Bases: RapidataSetting

Set a custom setting with the given key and value. Use this to enable features that do not have a dedicated method (yet).

Supported task types: all. As an arbitrary escape hatch it is never filtered by task type and never triggers a support warning.

Parameters:

Name Type Description Default
key str

The key for the custom setting.

required
value str

The value for the custom setting.

required
target Literal['rapids', 'campaign']

Whether the feature flag should be applied at the rapid level or the campaign level. Defaults to "rapids".

'rapids'
Source code in src/rapidata/rapidata_client/settings/custom_setting.py
def __init__(
    self,
    key: str,
    value: str,
    target: FeatureFlagTarget = "rapids",
):
    if not isinstance(key, str):
        raise ValueError("The key must be a string.")

    valid_targets = get_args(FeatureFlagTarget)
    if target not in valid_targets:
        raise ValueError(
            f"The target must be one of {valid_targets}, got {target!r}."
        )

    super().__init__(key=key, value=value, target=target)