Search documentation
karat

+

K

User Documentation ↗

transforms.api.StringParam

class transforms.api.StringParam(default, *, description=None, allowed_values=None)

Specification for the ParameterSpec definition used as an input to a transform.

  • Parameters:
    • default (str) – The default value for the parameter.
    • allowed_values (Optional *[*Set [str ] ]) – Allowed values for the parameter, as a set of strings.
    • description (str , optional) – The parameter description.

static instance(context, json_value, runtime_override=None)

Creates a parameter instance using the raw JSON value from JobSpec parameters and specific context.

The return value is injected in the transform compute function.

  • Parameters:
    • context (ParamContext) – A context object with properties that might be required for creating an instance.
    • json_value (any) – Any raw value deserialized from JobSpec parameters.

property json_value

Returns the JSON value for this parameter to put in JobSpec.

If the return value is None, the parameter is considered unbound. If any transform’s parameter is unbound, the transform is considered to be unbound. For unbound transforms, the JobSpec is not published.

property schema

Returns JSON schema for parameters of this type. Must return a valid JSON schema.