hello prefect team, hello community, i am currentl...
# ask-community
j
hello prefect team, hello community, i am currently setting up a deployment for a flow with a couple of boolean parameters with default values in prefect 2 and noticed that these are nicely displayed as switches in the flow run creation form. The switches are set to "False" irrespective of the actual default value. When these switches are not changed during the flow run creation, the flow run will be submitted without these parameters, and consequently using the default settings that could be "True". This results in a mismatch between what the user sees on flow submission and what's actually executed. However, if the switches are toggled back and forth, effectively resulting in the same state of the form, the flows are submitted with the parameters from the form, overwriting the default parameters. This means that toggling the switches back and forth results in a different outcome than not touching the switches at all, even though the form looks exactly the same. i think this could lead to some very hard to reproduce issues. where should i submit UI related bug reports? Please find an example flow in thread. Thanks a lot
👍 1
1
Copy code
from prefect import flow, get_run_logger


@flow(name="param_example")
def main(
    *,
    bool_true: bool = True,    # <-- Default TRUE
    bool_false: bool = False,  # <-- Default FALSE
) -> None:
    logger = get_run_logger()
    <http://logger.info|logger.info>(bool_true)
    <http://logger.info|logger.info>(bool_false)
default parameters are registered properly but switches for custom parameters are all "False". When submitting two flows with the exact same configuration, but toggling the switches back and forth on one submission results in execution of two flows with different parameter sets.
c
Hi Justin, these are some good finds - I think this would be helpful to open an issue on the UI repo here: https://github.com/PrefectHQ/ui
j