Wei Mei
08/22/2022, 7:48 PM- name_input: field required
I see that in the do not edit below line part of the deployment.yaml it has name_input set to required.
from prefect import flow, task
from prefect.tasks import task_input_hash
from datetime import timedelta
@task(cache_key_fn=task_input_hash, cache_expiration=timedelta(minutes=1))
def hello_task(name_input):
# Doing some work
print(f"Saying hello {name_input}")
return "hello " + name_input
@flow
def hello_flow(name_input):
hello_task(name_input)
if __name__ == "__main__":
hello_flow("Marvin")
Jeff Hale
08/22/2022, 7:51 PMdeployment build
command?Wei Mei
08/22/2022, 7:52 PMprefect deployment build tutorial8.py:hello_flow --name dev --tag dev
Wei Mei
08/22/2022, 7:52 PM###
### A complete description of a Prefect Deployment for flow 'hello-flow'
###
name: dev
description: null
version: 6141de3121e99956798d30ea890e6c44
# The work queue that will handle this deployment's runs
work_queue_name: dev
tags:
- dev
parameters: {}
schedule: null
infra_overrides: {}
###
### DO NOT EDIT BELOW THIS LINE
###
flow_name: hello-flow
manifest_path: null
infrastructure:
type: process
env: {}
labels: {}
name: null
command:
- python
- -m
- prefect.engine
stream_output: true
_block_document_id: 2ddaa9ca-0e26-4079-8ad0-3d4825178bb5
_block_document_name: anonymous-17a3bf0b-9c45-4c4e-be6f-f11d246964a8
_is_anonymous: true
storage: null
path: /Users/wei/Projects/prefect-extract-2
entrypoint: tutorial8.py:hello_flow
parameter_openapi_schema:
title: Parameters
type: object
properties:
name_input:
title: name_input
required:
- name_input
definitions: null
Jeff Hale
08/22/2022, 7:56 PMname_input
argument into your flow several ways.
Under parameters
in your deployment YAML manifest you can add a
name_input: marvin
Jeff Hale
08/22/2022, 7:56 PMWei Mei
08/22/2022, 7:58 PMJeff Hale
08/22/2022, 7:58 PMdef hello_flow(name_input):
Jeff Hale
08/22/2022, 7:58 PMWei Mei
08/22/2022, 7:58 PMWei Mei
08/22/2022, 7:58 PMJeff Hale
08/22/2022, 8:03 PM