https://prefect.io logo
Title
v

Vera Zabeida

03/23/2023, 7:37 PM
this is new..used to be able to just enter my parameters as strings, didn't need to provide JSON, wish there had been a headsup or something
n

nicholas

03/23/2023, 7:45 PM
Oo this looks like a regression @Vera Zabeida - let me investigate what’s up here
v

Vera Zabeida

03/23/2023, 7:52 PM
thank you : )
n

nicholas

03/23/2023, 8:36 PM
Hi @Vera Zabeida - any chance you can make a min reproducible example? I’m having trouble reproducing
v

Vera Zabeida

03/23/2023, 8:40 PM
this is the Prefect Cloud UI, in the deployments section, here's the flow code: https://github.com/VeraZab/nyc-stats/blob/main/flows/pipeline.py#L94 and i'm just trying to do a custom run where i put custom to and from dates 2015-01-01 to 2015-12-31 for example.. it used to work to just have these as strings, like literally 2-3hrs ago.. now its asking me for json...
n

nicholas

03/23/2023, 8:50 PM
Ahhhh ok, thanks for the help @Vera Zabeida, I see the issue. The problem is that your inputs aren’t typed so we don’t really know what to do with them. Rather than attempting to infer a type, it looks like we’re offering you a JSON input so you can provide what you’re looking for directly. If your flow is expecting a date string, you can use the JSON input for that like this:
(a string is valid JSON)
v

Vera Zabeida

03/23/2023, 8:52 PM
oh ok : ) i guess I was confused as this used to work a few hours ago : )
thank you!
n

nicholas

03/23/2023, 8:53 PM
However! If you add types to your inputs, the UI can get a lot more powerful there, so if you changed your code like this:
import datetime

@flow(log_prints=True, name="extracting and loading")
  def extract_and_load(from_date: datetime.date, to_date: datetime.date):
    ...
you’ll get a much more robust experience:
v

Vera Zabeida

03/23/2023, 8:55 PM
wow thank you so much!
n

nicholas

03/23/2023, 8:55 PM
absolutely! lmk if you have any other questions
💙 2