Awaish Kumar
01/30/2024, 9:12 AMFailed due to a TypeError: xyz() missing 1 required positional argument: 'name' in the Prefect flow run.
Code snippet:
@flow(flow_run_name=generate_flow_run_name, retries=3, validate_parameters=False, retry_delay_seconds=60, log_prints=True)
def xyz(name: str):
xyz_task()
if __name__ == "__main__":
xyz(name="myflow")
Any help would be much appreciated!!!Robin Niel
01/30/2024, 9:17 AMAwaish Kumar
01/30/2024, 9:47 AMxyz(name="myflow")
I am always specifying the name. As you can see but why it is not able to read it.Robin Niel
01/30/2024, 9:48 AMAwaish Kumar
01/30/2024, 9:53 AMif __name__ == "__main__":
is the problem here. because it example flows it is doing something similar but without ``if name == "__main__":``
@flow(name="Hello Flow")
def hello_world(name="world"):
message = print_hello(name)
hello_world("Marvin")
Awaish Kumar
01/30/2024, 9:54 AMRobin Niel
01/30/2024, 9:56 AM