https://prefect.io logo
Title
e

eddy davies

08/02/2022, 10:54 AM
The docs show use of docstrings as flow descriptions but I cannot get that working, thoughts?
👀 2
1
from prefect import flow

@flow(name="My Example Flow")
    """An example flow for a tutorial."""
def my_flow():
    # run tasks and subflows
b

Bianca Hoch

08/02/2022, 2:23 PM
Hi Eddy, thanks for reporting this, I can't seem to get it to work as intended either with the following:
from prefect import flow

@flow(name="My Example Flow")
    """An example flow for a tutorial."""
def my_flow():
    print("Hi, this is my flow!")


my_flow()
I'll raise this to the team and see what's going on here.
e

eddy davies

08/02/2022, 2:48 PM
Sweet
k

Khuyen Tran

08/02/2022, 5:05 PM
It should be this:
from prefect import flow


@flow(name="My Example Flow")
def my_flow():
    """An example flow for a tutorial."""
    # run tasks and subflows


assert my_flow.description == "An example flow for a tutorial."
We will fix this as soon as possible
e

eddy davies

08/03/2022, 10:52 AM
Where should this description appear? I cannot see one added with description parameter or docstring anywhere cli or prefect ui
k

Khuyen Tran

08/03/2022, 3:06 PM
It will appear in your Prefect UI under Deployments
e

eddy davies

08/04/2022, 7:58 AM
Not sure if I am using this wrong but I cannot see the description appearing
k

Khuyen Tran

08/04/2022, 3:12 PM
Sorry for the wrong suggestion. To add the description to the deployment, you want to add the description to the
deployment.yaml
files or through the UI
# deployment.yaml
name: hello
description: your description here
tags:
- test
schedule: null
parameters: {}
infrastructure:
  type: process
  env: {}
  labels: {}
  name: null
  command:
  - python
  - -m
  - prefect.engine
  stream_output: true
e

eddy davies

08/05/2022, 7:54 AM
That's good to know but where are the descriptions added to Flows or Tasks directly (with a
description
parameter or docstring) shown?
c

Chris L.

08/09/2022, 3:34 AM
Hello there! Wondering if there is any update regarding the description kwarg in
flow()
and the supposed auto docs from flow docstring functionality.
k

Khuyen Tran

08/09/2022, 2:32 PM
For now, the
description
parameter from a flow is not visible. We recommend that you add the description to a deployment instead of a flow.
b

Bianca Hoch

08/09/2022, 2:36 PM
Hello everyone, to give this issue more visibility, would you mind opening a github issue here describing what you're seeing?
k

Khuyen Tran

08/09/2022, 2:37 PM
Update: The description will be visible in the UI with a release to be shipped later this week.
🎉 1
:party-parrot: 2
🙏 1
b

Bianca Hoch

08/09/2022, 2:38 PM
Thank you @Khuyen Tran!