Hello! Are there any plans to include flows return annotations to the deployment info same as of input parameters in
parameter_openapi_schema
✅ 1
z
Zanie
01/10/2023, 5:58 PM
Not yet! Sounds useful in the long run though, feel free to open a request on GitHub to track this.
p
Paco Ibañez
01/10/2023, 6:01 PM
Thanks! to work around it I am trying to use more complex input annotations and although
parameter_openapi_schema
returns the model properly, the prefect UI does not render the inner pydantic models. Any plans to render more complex models in the near future?
example:
Copy code
CdpStepInput = TypeVar('CdpStepInput', bound=BaseModel)
CdpStepResultSpec = TypeVar('CdpStepResultSpec', bound=BaseModel)
class StepExecutionContext(GenericModel, Generic[CdpStepInput, CdpStepResultSpec]):
input: Optional[CdpStepInput]
result_spec: Optional[CdpStepResultSpec]
class InputParams(BaseModel):
csv_url: str = Field(None, description="the url of remote storage containing csv to load")
storage_config: Optional[SecretStr] = "{}" # json encoded dict with storage options
columns: Optional[List[str]] = None
class OuputSpec(BaseModel):
output_url: str = Field(None, description="the url to feather file containing loaded dataframe")
@flow
def step(request: StepExecutionContext[InputParams, OuputSpec]):
pass
z
Zanie
01/10/2023, 6:03 PM
I believe there’s an issue for that already, but rendering nested complex models is a bit tricky.
p
Paco Ibañez
01/10/2023, 6:04 PM
I see. I will look at github to find the issue. Thanks for your quick response!
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.