Ike
09/11/2019, 4:35 PMChris White
09/11/2019, 4:36 PMIke
09/11/2019, 4:39 PMChris White
09/11/2019, 4:42 PMrun
method of the task. Two options:
- directly reassign the docstring (my_task.__doc__ = my_task.run.__doc__
)
- have sphinx look at my_task.run
when generating docsIke
09/11/2019, 4:56 PMChris White
09/11/2019, 4:56 PMMarvin
09/11/2019, 4:56 PMJerry Thomas
09/12/2019, 4:17 PMmy_task.__doc__ = my_task.run.__doc__
go? After the @task
annotation or within the function or just anywhere in the file?Chris White
09/12/2019, 4:20 PM@task
annotationJerry Thomas
09/13/2019, 8:52 AM@task()
process_itemwise.__doc__ = process_itemwise.run.__doc__
def process_itemwise(data):
"""processes individual items
Args:
data: A dict of values
"""
data["result"] = 1
return data
I am not able to get this to work. If I use this, it does not execute. I get syntax error. I tried putting it inside the function and after the function as well. But no luck.Chris White
09/13/2019, 3:57 PM@task()
def process_itemwise(data):
"""processes individual items
Args:
data: A dict of values
"""
data["result"] = 1
return data
process_itemwise.__doc__ = process_itemwise.run.__doc__
Jerry Thomas
09/16/2019, 6:25 AM"""Sample module to verify sphinx doc generation
"""
from prefect import task
@task()
def process_itemwise(data):
"""processes individual items
Args:
data: A dict of values
"""
data["result"] = 1
return data
process_itemwise.__doc__ = process_itemwise.run.__doc__
When I run python setup.py docs
the html documentation only shows the module comment and the function itself does not appear. If I remove the @task annotation the function documentation appears.
I had used pyscaffold to create the initial repo and then added this fle.Chris White
09/16/2019, 4:12 PM__doc__
line just ensures that the docstring for your task agrees with the doc string that you wrote (and I might actually PR a change to Core so that you don’t have to manually do this)Jerry Thomas
09/16/2019, 4:15 PM@task
annotations.