MCPcopy
hub / github.com/celery/celery / x

Function x

examples/pydantic/tasks.py:17–21  ·  view source on GitHub ↗
(arg: ArgModel)

Source from the content-addressed store, hash-verified

15
16@app.task(pydantic=True)
17def x(arg: ArgModel) -> ReturnModel:
18 # args/kwargs type hinted as Pydantic model will be converted
19 assert isinstance(arg, ArgModel)
20 # The returned model will be converted to a dict automatically
21 return ReturnModel(value=f"example: {arg.value}")

Callers 12

test_iterMethod · 0.85
test_stackMethod · 0.85
test_callMethod · 0.85
test_chunksMethod · 0.85
test_call_no_tasksMethod · 0.85
test_call_with_tasksMethod · 0.85
test_call_empty_groupMethod · 0.85
test_eagerMethod · 0.85
test_applyMethod · 0.85
test_promiseMethod · 0.85

Calls 1

ReturnModelClass · 0.70

Tested by 12

test_iterMethod · 0.68
test_stackMethod · 0.68
test_callMethod · 0.68
test_chunksMethod · 0.68
test_call_no_tasksMethod · 0.68
test_call_with_tasksMethod · 0.68
test_call_empty_groupMethod · 0.68
test_eagerMethod · 0.68
test_applyMethod · 0.68
test_promiseMethod · 0.68