MCPcopy Create free account
hub / github.com/RedisGears/RedisGears / DAGRun

Function DAGRun

plugins/python/redisgears_python.c:2653–2676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2651}
2652
2653static PyObject* DAGRun(PyObject *self){
2654 verifyRedisAILoaded();
2655 PyDAGRunner *pyDag = (PyDAGRunner *)self;
2656 if(!_IsDagAPISupported(RedisAI_DAGRun) || !_IsValidDag(pyDag)) {
2657 return NULL;
2658 }
2659 PyObject* pArgs = PyTuple_New(0);
2660 PyObject* future = PyObject_CallObject(createFutureFunction, pArgs);
2661 GearsPyDecRef(pArgs);
2662
2663 RAI_Error *err;
2664 RedisAI_InitError(&err);
2665 int status = RedisAI_DAGRun(pyDag->dag, FinishAsyncDAGRun, future, err);
2666 if (status == REDISMODULE_ERR) {
2667 PyErr_SetString(GearsError, RedisAI_GetError(err));
2668 pyDag->dag = NULL;
2669 RedisAI_FreeError(err);
2670 return NULL;
2671 }
2672 pyDag->dag = NULL;
2673 RedisAI_FreeError(err);
2674 Py_INCREF(future);
2675 return future;
2676}
2677
2678// LCOV_EXCL_STOP
2679

Callers

nothing calls this directly

Calls 3

_IsDagAPISupportedFunction · 0.85
_IsValidDagFunction · 0.85
GearsPyDecRefFunction · 0.85

Tested by

no test coverage detected