By adding the @morph.func
annotation, you can register the function to be executed with morph.
@morph.func(
name: str | None = None,
description: str | None = None,
)
def func_name(context):
# write your code here
Parameters
name
string
default:"Function name"
The name of the process, which can also be used as an alias when called from other files.
A description of the process can be written.
How to Use
@morph.func(
name="example_python_cell",
description="Example Python cell",
)
def get_data_from_database(context):
# write your code here
return pd.DataFrame({
"name": ["John", "Doe"],
"age": [20, 30],
})