Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow formatting of flow parameter documentation strings #15373

Open
tjordahl opened this issue Sep 13, 2024 · 0 comments
Open

Allow formatting of flow parameter documentation strings #15373

tjordahl opened this issue Sep 13, 2024 · 0 comments
Labels
enhancement An improvement of an existing feature

Comments

@tjordahl
Copy link

tjordahl commented Sep 13, 2024

Describe the current behavior

Currently the docstring of (e.g.) enum parameters is dumped on to the UI as one long string. This makes it hard to self-document flow parameters for people running flows.

Example:

from pydantic import BaseModel

from prefect import flow


class BadParams(BaseModel):
    """This is a realllllly long description that should be rendered as markdown


    Attributes:
        a: This is a really long description that should be rendered as markdown
        b: This is a really long description that should be rendered as markdown
        c: This is a really long description that should be rendered as markdown
        x: This is a really long description that should be rendered as markdown
        y: This is a really long description that should be rendered as markdown
        z: This is a really long description that should be rendered as markdown
    """

    a: int
    b: int
    c: int
    x: int
    y: int
    z: int


@flow
def bad_params_render(params: BadParams):
    pass


if __name__ == "__main__":
    bad_params_render.serve()

image

Describe the proposed behavior

Support some sort of formatting, Markdown would be the obvious choice, to allow flow developers to nicely format this text.

Example Use

No response

Additional context

Prefect slack thread from 2024-09-13:
https://prefect-community.slack.com/archives/C0192RWGJQH/p1726235752005299

@tjordahl tjordahl added the enhancement An improvement of an existing feature label Sep 13, 2024
@zzstoatzz zzstoatzz added ui Related to the Prefect web interface and removed ui Related to the Prefect web interface labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
Status: Backlog
Development

No branches or pull requests

2 participants