https://prefect.io logo
m

Max Eggers

07/10/2023, 2:45 PM
I am seeing some new weirdness in the Flow Custom Run UI when trying to set Union fields, the Union object I select and the values that I set on it seem to be lost when starting the flow. The values are missing from the parameters JSON in the flow run
c

Christopher Boyd

07/10/2023, 2:45 PM
Can you share your inputs (how you are submitting), and paramters after the flow run starts?
m

Max Eggers

07/10/2023, 2:46 PM
Yeah, I'll try to distill the issue into a simpler param model
c

Christopher Boyd

07/10/2023, 2:46 PM
I’ve reported a recent JSON bug with the UI, so just trying to determine if this is related, or separate
m

Max Eggers

07/10/2023, 2:55 PM
Gotcha - maybe this will help for now: Model definition looks something like
Copy code
class ParamGroup(BaseModel):
   another_field: Int
   specific_param: Union[ThingOne, ThingTwo, Etc] = Field(description="whatever")

class Params(BaseModel):
   a_field: Int
   param_group: ParamGroup
The UI renders the union field fine, and each model in the union has fields that I can set fine. But then when I run the flow the params look something like:
Copy code
{
   a_field: 123
   param_group: {
      another_field: 123
   }
}
Notice
specific_param
is not present. And then another layer of weirdness is when I make the JSON myself, like:
Copy code
{
   a_field: 123
   param_group: {
      another_field: 123
      specific_param: {whatever: 123}
   }
}
and paste it into the JSON for a new flow run, the value is lost and the resulting text is
Copy code
{
   a_field: 123
   param_group: {
      another_field: 123
      specific_param: {}
   }
}
👀 1
🙏 1
I can workaround the issue by then deleting the whole JSON field and repasting, and then the value is pasted correctly. Pretty bizarre. We just started noticing this 7/7 although we had a pretty slow week last week so may not have noticed right when it started happening
c

Christopher Boyd

07/10/2023, 3:54 PM
So I want to make sure I follow ok
when you put these values in - are you putting them in the Custom paramters tab, and if so , how are you pasting them in? And it works if you paste the full JSON input into the JSON tab?
Does this seem similar to your issue, or unrelated? https://github.com/PrefectHQ/prefect-ui-library/issues/1561
👀 1
m

Max Eggers

07/10/2023, 4:03 PM
Yeah putting them in the Custom parameters tab. It doesn't work right away if I paste in the full JSON, for some reason when I first paste in the json the field-value-pairs set on the Union object get lost, then if I delete it all and re-paste it works.
c

Christopher Boyd

07/10/2023, 4:05 PM
Could you do a simple screen capture / recording like 20 seconds, or a repro for me if possible? We’ve had a couple UI bugs, and in the process of fixing this one, want to make sure we hit all the cases
m

Max Eggers

07/10/2023, 4:05 PM
Yeah I will put together a repro
🙏 1
Steps to Reproduce: 1. Make new deployment for flow 2. In Prefect Cloud UI, make a new custom run on the deployment 3. On Custom tab, fill out parameters a. Choose CModel and fill out "A Third Nested Parameter" 4. Submit. Notice flow fails due to validation error. Look at parameters and see that there is no value for the union parameter
🙏 2
image.png
image.png
image.png
c

Christopher Boyd

07/10/2023, 5:56 PM
Thank you @Max Eggers, I’m looking / testing this now
m

Max Eggers

07/10/2023, 5:56 PM
Thank you!
c

Christopher Boyd

07/10/2023, 6:04 PM
Just verifying, previously this was working for you right ? With no changes on inputs or flows ?
m

Max Eggers

07/10/2023, 7:06 PM
correct
first day we noticed it not working was 7/7 after it had worked previously 6/30 with no changes on our side in between
1
should I create an issue on gh for this?
c

Christopher Boyd

07/10/2023, 9:13 PM
I’ve been working with the backend team on this, a fix is being worked on related
I don’t think we need a new separate issue, I’ll be using your repro as a test case before releasing it to ensure we got it fixed here too
m

Max Eggers

07/10/2023, 9:13 PM
👍 sounds good, thank you
@Evan Curtin FYI ^
c

Christopher Boyd

07/11/2023, 4:08 PM
https://github.com/PrefectHQ/prefect-ui-library/pull/1563 is being merged, I’m working with the team to make sure this satisfied your repro as well
m

Max Eggers

07/11/2023, 4:09 PM
👍 thanks for the update
c

Christopher Boyd

07/11/2023, 6:00 PM
We tested this successfully in staging, but currently working through some other test cases before this gets released, I’ll keep you posted
m

Max Eggers

07/11/2023, 6:27 PM
Sweet!
e

Evan Curtin

07/12/2023, 2:55 PM
please keep us posted we can test out when the release is pushed. This caused us to fail runs as validation errors but if it failed a bit more silently in parameter passing it may cost us several thousand dollars of compute
c

Christopher Boyd

07/12/2023, 3:27 PM
Release should be pushed today - I’m sorry to hear that
m

Max Eggers

07/13/2023, 7:51 PM
Is this fixed with the latest release?
c

Christopher Boyd

07/13/2023, 7:51 PM
Ah yes - this was pushed out yesterday
m

Max Eggers

07/13/2023, 7:52 PM
Cool - looks like my repro is fixed - thank you!
1
🙌 1
c

Christopher Boyd

07/13/2023, 7:53 PM
I was worried for a second because we were using your repro to test 😮
m

Max Eggers

07/13/2023, 7:53 PM
🙂 I was just holding off testing until I heard about a deployment
c

Christopher Boyd

07/13/2023, 7:54 PM
gotcha, yea! There were a couple fixes pushed, but I think it shored up all the reports we’d seen / repro’d
m

Max Eggers

07/13/2023, 7:54 PM
Sweet - thanks again!
2 Views