Thread
#data-tricks-and-tips
    eddy davies

    eddy davies

    1 month ago
    The docs show use of docstrings as flow descriptions but I cannot get that working, thoughts?
    from prefect import flow
    
    @flow(name="My Example Flow")
        """An example flow for a tutorial."""
    def my_flow():
        # run tasks and subflows
    Bianca Hoch

    Bianca Hoch

    1 month ago
    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.
    eddy davies

    eddy davies

    1 month ago
    Sweet
    Khuyen Tran

    Khuyen Tran

    1 month ago
    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
    eddy davies

    eddy davies

    1 month ago
    Where should this description appear? I cannot see one added with description parameter or docstring anywhere cli or prefect ui
    Khuyen Tran

    Khuyen Tran

    1 month ago
    It will appear in your Prefect UI under Deployments
    eddy davies

    eddy davies

    1 month ago
    Not sure if I am using this wrong but I cannot see the description appearing
    Khuyen Tran

    Khuyen Tran

    1 month ago
    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
    eddy davies

    eddy davies

    1 month ago
    That's good to know but where are the descriptions added to Flows or Tasks directly (with a
    description
    parameter or docstring) shown?
    Chris L.

    Chris L.

    1 month ago
    Hello there! Wondering if there is any update regarding the description kwarg in
    flow()
    and the supposed auto docs from flow docstring functionality.
    Khuyen Tran

    Khuyen Tran

    1 month ago
    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.
    Bianca Hoch

    Bianca Hoch

    1 month ago
    Hello everyone, to give this issue more visibility, would you mind opening a github issue here describing what you're seeing?
    Khuyen Tran

    Khuyen Tran

    1 month ago
    Update: The description will be visible in the UI with a release to be shipped later this week.
    Bianca Hoch

    Bianca Hoch

    1 month ago
    Thank you @Khuyen Tran!