MCPcopy Create free account
hub / github.com/dataease/SQLBot / enable_training

Function enable_training

backend/apps/data_training/curd/data_training.py:407–418  ·  view source on GitHub ↗
(session: SessionDep, id: int, enabled: bool, trans: Trans)

Source from the content-addressed store, hash-verified

405
406
407def enable_training(session: SessionDep, id: int, enabled: bool, trans: Trans):
408 count = session.query(DataTraining).filter(
409 DataTraining.id == id
410 ).count()
411 if count == 0:
412 raise Exception(trans('i18n_data_training.data_training_not_exists'))
413
414 stmt = update(DataTraining).where(and_(DataTraining.id == id)).values(
415 enabled=enabled,
416 )
417 session.execute(stmt)
418 session.commit()
419
420
421# def run_save_embeddings(ids: List[int]):

Callers 1

enableFunction · 0.90

Calls 3

updateFunction · 0.50
filterMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected