Kalo
06/01/2023, 1:45 PM@flow
def get_weather_data(lat, lon):
weather_data = fetch_weather(lat, lon)
soil_data = fetch_soil_data(lat, lon)
to_write = transform_weather_data(weather_data, soil_data)
save_weather(to_write)
if __name__ == '__main__':
get_weather_data()
2. I created a deployment and left parameters
as an empty dict:
deployments:
- name: My weather deployment
version: 0.1
tags: [ ]
description: null
schedule: { }
flow_name: null
entrypoint: "weather.py:get_weather_data"
parameters: {}
work_pool:
name: null
work_queue_name: null
job_variables: { }
3. I deployed it: prefect deploy "./weather.py:get_weather_data" -p my_pool
4. Now if I open the deployment in the UI and choose "Quick Run", I am shown a form with lat
and lon
fields, which are empty, but they're also marked as (Optional) when they clearly aren't. The Run button is also enabled, it allows me to click it even if I leave the form fields empty, and if I do that, the flow fails. Did I do something wrong?Emil Christensen
06/01/2023, 1:51 PMKalo
06/01/2023, 1:53 PM@flow
def get_weather_data(lat: float, lon: float):
weather_data = fetch_weather(lat, lon)
soil_data = fetch_soil_data(lat, lon)
to_write = transform_weather_data(weather_data, soil_data)
save_weather(to_write)
Emil Christensen
06/01/2023, 2:16 PMargs
should be required, though perhaps there are technical reasons preventing it. We have to do a non-trivial amount of translation from Pydantic -> openAPI schema -> UI componentsEmil Christensen
06/01/2023, 2:17 PM