This commit is contained in:
parent
b1bd86962f
commit
e0339c940d
2 changed files with 22 additions and 11 deletions
13
src/knoc_plugin_template/process.py
Normal file
13
src/knoc_plugin_template/process.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from knoc_plugin_template import __version__
|
||||
|
||||
|
||||
class SimpleOutput(BaseModel):
|
||||
message: str
|
||||
|
||||
|
||||
async def plugin_template_process() -> SimpleOutput:
|
||||
return SimpleOutput(message=f"Foo v{__version__} at {datetime.now()}")
|
|
@ -1,15 +1,9 @@
|
|||
from datetime import datetime
|
||||
from pydantic import BaseModel
|
||||
|
||||
from hatchet_sdk import Context, EmptyModel
|
||||
|
||||
from knoc_plugin_template import __version__
|
||||
from knoc.settings import settings
|
||||
from knoc.hatchet_client import hatchet
|
||||
|
||||
|
||||
class SimpleOutput(BaseModel):
|
||||
message: str
|
||||
from pandas._libs.lib import is_np_dtype
|
||||
from knoc_plugin_template import __version__
|
||||
from knoc_plugin_template.process import plugin_template_process, SimpleOutput
|
||||
|
||||
|
||||
do_nothing_wf = hatchet.workflow(
|
||||
|
@ -18,7 +12,11 @@ do_nothing_wf = hatchet.workflow(
|
|||
)
|
||||
|
||||
|
||||
@do_nothing_wf.task()
|
||||
@hatchet.task(input_validator=EmptyModel)
|
||||
async def do_nothing(input: EmptyModel, ctx: Context) -> SimpleOutput:
|
||||
"""A template for Do nothing"""
|
||||
ctx.log("Just a workflow template")
|
||||
return SimpleOutput(message=f"Foo v{__version__} at {datetime.now()}")
|
||||
return await plugin_template_process()
|
||||
|
||||
|
||||
do_nothing_wf.add_task(do_nothing)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue