https://prefect.io logo
i

Iurii Mokrii

08/10/2023, 2:05 PM
Hi! I ran into a bug in ui (in cloud and onprem versions) - when I am trying to run deployments from ui - JsonView of parameters somehow completely ignore default values of nested parameters (the Custom view works well). Since then the contents of JsonView is used to run flows - it leads to incorrect parameters in runs. Attaching screencast and code to create deployment.
Copy code
import prefect
import pydantic
from prefect.deployments.deployments import Deployment


class SubParams(pydantic.BaseModel):
    param1: str = "2"
    param2: str = "1"

class Params(pydantic.BaseModel):
    param3: str
    sub_params: SubParams = SubParams()


@prefect.flow
def flow(params: Params):
    pass

deployment = Deployment.build_from_flow(flow=flow, name="just flow 2")
deployment.apply()
j

Jenny

08/15/2023, 5:32 PM
Hi Lurri - the JSON tab is an advanced input mode which shows the API-ready mapped key values for your parameters. In order to properly support runtime defaults, the UI strips parameter key/values that match the defaults present in the schema when mapping from UI value => API value. We realize it's a little confusing so hope to do some work to improve the UX here so thank you for the feedback!