https://prefect.io logo
t

Tim-Oliver

07/14/2023, 11:29 AM
Hi, When performing "copy to a new run" the parameters of
pydantic.BaseModel
inputs are missing. They are visible in the default and custom view, but missing in the json view. Starting the flow-run results in an error that the respective parameters are missing.
j

Jenny

07/14/2023, 12:46 PM
Hey @Tim-Oliver - what version of prefect are you on? If you aren't on the latest can you try updating and check if you still see the issue? (We did some updates to UI handling of inputs recently). If you are on latest (2.10.21) could you provide a code snippet/MRE so we can try replicate and investigate? Thank you!
t

Tim-Oliver

07/14/2023, 12:52 PM
I am using prefect-cloud. Will create a code-snippet later today 🙂
j

Jenny

07/14/2023, 12:52 PM
Thank you! 🙏
t

Tim-Oliver

07/14/2023, 1:51 PM
Okay, this flow (https://github.com/fmi-basel/gfriedri-em-alignment-flows/blob/refactor-tile-registration/01_tile-stitching/prefect_tile_stitching.py#L167-L195) submitted via Python shows up in the cloud UI as expected with all its parameters:
Copy code
{
  "stride": 20,
  "mesh_files": [
    "/test/output/sections/s1080_g1/meshes.npz",
    "/test/output/sections/s1094_g1/meshes.npz",
    "/test/output/sections/s1082_g1/meshes.npz",
    "/test/output/sections/s1077_g1/meshes.npz",
    "/test/output/sections/s1093_g1/meshes.npz",
    "/test/output/sections/s1089_g1/meshes.npz",
    "/test/output/sections/s1076_g1/meshes.npz",
    "/test/output/sections/s1090_g1/meshes.npz"
  ],
  "output_dir": "/test/output/stitched-sections",
  "warp_config": {
    "nbins": 256,
    "margin": 20,
    "use_clahe": true,
    "clip_limit": 0.01,
    "kernel_size": 1024,
    "warp_parallelism": 5
  }
}
If I now go on "copy to new run" from this completed run the "warp_config" parameter is missing in the json view. If I submit the flow-run I get the error that the "warp_config" parameter is missing. The obvious work-around would be to just copy-paste the complete json into the json-form. However, the flow still fails with the message that "warp_config" is missing. One important thing might be that all values in "warp_config" are equal to the default values in that case.
j

Jenny

07/17/2023, 6:34 PM
Sorry @Tim-Oliver - I passed onto our UI engineers and forgot to come back to update you. We're looking into it!
c

Craig Harshbarger

07/17/2023, 7:52 PM
@Tim Galvin thanks for bringing this up. This is something we're aware of in a general sense and something we want to improve but for various reasons we're un able to without reworking the codebase. But this there is a simple work around. If you change your flow definition to include a default
WarpConfig
it'll work just how you'd expect. I see you're already doing this in the
tile_stitching
flow so I think this will work fine for your use case.
Copy code
def warp_tiles_flow(
    output_dir: str,
    mesh_files: list[str],
    stride: int,
    warp_config: WarpConfig = WarpConfig(),
):
🙏 1