<@ULVA73B9P> In prefect.yaml templating, is it pos...
# ask-marvin
o
@Marvin In prefect.yaml templating, is it possible to set a boolean value when a variable is set to a specific string? E.g. I have a prefect variable "environment" that shall determine whether deployments run in that environment. I would like to set the active value of the schedule to true for "production", false for "staging".
m
In Prefect, you can use templating in your
prefect.yaml
file to dynamically set values, but it seems that conditional logic like setting a boolean based on a specific string value isn't directly supported in the YAML templating itself. Prefect's templating allows you to reference dynamic values using variables, blocks, and step outputs, but it doesn't provide built-in conditional logic for transforming values based on conditions. To achieve your goal of setting the active value of the schedule based on the environment, you might consider handling this logic in your Python code and passing the result to your deployment configuration. For example, you could set an environment variable or use Prefect's Python SDK to programmatically create or update the deployment with the desired schedule settings. For more details on Prefect YAML and its capabilities, you can refer to the Prefect YAML documentation.