def get_trainingjob(id: int=None):
if id is not None:
- try:
- tj = TrainingJob.query.filter(TrainingJob.id==id).one()
- return tj
- except NoResultFound as err:
- raise DBException(f"Failed to get trainingjob by id: {id} due to {str(err)}")
+ return TrainingJob.query.filter(TrainingJob.id==id).one()
else:
tjs = TrainingJob.query.all()
return tjs
from trainingmgr.service.featuregroup_service import get_featuregroup_by_name, get_featuregroup_from_inputDataType
from trainingmgr.common.trainingmgr_config import TrainingMgrConfig
from trainingmgr.constants import Steps, States
+from sqlalchemy.orm.exc import NoResultFound
trainingJobSchema = TrainingJobSchema()
trainingJobsSchema = TrainingJobSchema(many=True)
return True
else:
return False
+ except NoResultFound :
+ return False
except Exception as err :
raise DBException(f"delete_trainining_job failed with exception : {str(err)}")
return trainingjob
except Exception as err:
LOGGER.error(f"error in updating the trainingPipeline due to {str(err)}")
- raise TMException("failed to update the trainingPipeline")
\ No newline at end of file
+ raise TMException("failed to update the trainingPipeline")