MCPcopy Index your code
hub / github.com/dataease/SQLBot / create_or_update

Function create_or_update

backend/apps/data_training/api/data_training.py:49–54  ·  view source on GitHub ↗
(session: SessionDep, current_user: CurrentUser, trans: Trans, info: DataTrainingInfo)

Source from the content-addressed store, hash-verified

47@require_permissions(permission=SqlbotPermission(role=['ws_admin'], type='ds', keyExpression="info.datasource"))
48@system_log(LogConfig(operation_type=OperationType.CREATE_OR_UPDATE, module=OperationModules.DATA_TRAINING,resource_id_expr='info.id', result_id_expr="result_self"))
49async def create_or_update(session: SessionDep, current_user: CurrentUser, trans: Trans, info: DataTrainingInfo):
50 oid = current_user.oid
51 if info.id:
52 return update_training(session, info, oid, trans)
53 else:
54 return create_training(session, info, oid, trans)
55
56
57@router.delete("", summary=f"{PLACEHOLDER_PREFIX}delete_dt")

Callers

nothing calls this directly

Calls 2

update_trainingFunction · 0.90
create_trainingFunction · 0.90

Tested by

no test coverage detected