from typing import Optional
import typer
from prefect import flow
# @flow
def load_ids_flow(
file_date: Optional[str] = typer.Argument(None),
) -> None:
if file_date:
print(f"File date is {file_date}")
else:
file_date = typer.prompt("What's the file date in YYYYMMDD?")
print(f"You've entered {file_date}")
# do something else with this file date...
if __name__ == "__main__":
typer.run(load_ids_flow)
kiran
03/29/2023, 8:51 PM
As a flow, I get
TypeError: Object of type 'ArgumentInfo' is not JSON serializable
kiran
03/29/2023, 8:55 PM
Context is that I’d like to do this in case I’m running a one-off from the CLI and I forget how the script is supposed to work (it’ll prompt me with the proper info)
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.