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

[Core Feature] Documentation Hub: Pass user intput & output variable descriptions #1235

Closed
katrogan opened this issue Jul 13, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request flytekit FlyteKit Python related issue
Milestone

Comments

@katrogan
Copy link
Contributor

katrogan commented Jul 13, 2021

Motivation: Why do you think this is important?
As part of #531 it will be necessary to parse user docstrings to add variable descriptions to populate this field. The UI can render these descriptions to aid in visualizing and launching workflows and eventually these may be searchable as well

Goal: What should the final outcome look like, ideally?
Referencing the suggested python rst docstring format,

say for example a user defines a python task using RST documentation for an example like so

@task 
def my_task(foo: int, bar: str) -> bool:
    """
    :param foo: Some foo description here
    :param bar: Other bar description here

    :return: Description of return type here
    ...

We want to capture these sphinx-style docstrings and use them for the variable descriptions. Note, since we're using python 3 we don't need the docstrings to capture the variable types (so those are entirely optional)

It might help to take a look at transform_signature_to_interface as part of getting started on this.

We'll want to capture both task and workflow input and output variable descriptions

Other things to consider:

  • NamedTuples as return types: If multiple objects are returned we'll want to specify descriptions for each response object
  • Do we want to support additional user documentation formats such as napoleon?

These considerations can be handled in follow-up PRs.

The flytekit Variable already supports serializing descriptions so initializing it with a description is all that is necessary.

Describe alternatives you've considered
This python PEP proposes an RST-native docstring format so keeping with the official python guidance should be sufficient.

[Optional] Propose: Link/Inline OR Additional context
If you have ideas about the implementation please propose the change. If inline keep it short, if larger then you link to an external document.

@wild-endeavor
Copy link
Contributor

See also #940

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request flytekit FlyteKit Python related issue
Projects
None yet
Development

No branches or pull requests

3 participants