Skip to content

Commit 6626021

Browse files
committed
Rename DAGRUN to DAGRUN_RO
1 parent 58cfc3d commit 6626021

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/redisai.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ int RedisAI_DagRun_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
987987
}
988988

989989
/**
990-
* AI.DAGRUNRO [LOAD <nkeys> key1 key2... ] |> [COMMAND1] |> [COMMAND2] |> [COMMANDN]
990+
* AI.DAGRUN_RO [LOAD <nkeys> key1 key2... ] |> [COMMAND1] |> [COMMAND2] |> [COMMANDN]
991991
*
992992
* Read-only (no PERSIST) DAG execution.
993993
* The request is queued and evaded asynchronously from a separate thread. The
@@ -1095,6 +1095,7 @@ int RedisAI_DagRunRO_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv,
10951095

10961096
return REDISMODULE_OK;
10971097
}
1098+
10981099
#define EXECUTION_PLAN_FREE_MSG 100
10991100

11001101
#define REGISTER_API(name, ctx) \
@@ -1244,7 +1245,7 @@ int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
12441245
== REDISMODULE_ERR)
12451246
return REDISMODULE_ERR;
12461247

1247-
if (RedisModule_CreateCommand(ctx, "ai.dagrunro", RedisAI_DagRunRO_RedisCommand, "readonly", 3, 3, 1)
1248+
if (RedisModule_CreateCommand(ctx, "ai.dagrun_ro", RedisAI_DagRunRO_RedisCommand, "readonly", 3, 3, 1)
12481249
== REDISMODULE_ERR)
12491250
return REDISMODULE_ERR;
12501251

test/tests_dag.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_dagro_common_errors(env):
103103

104104
# ERR unsupported command within DAG
105105
try:
106-
command = "AI.DAGRUNRO |> "\
106+
command = "AI.DAGRUN_RO |> "\
107107
"AI.DONTEXIST tensor1 FLOAT 1 2 VALUES 5 10"
108108

109109
ret = con.execute_command(command)
@@ -114,17 +114,17 @@ def test_dagro_common_errors(env):
114114

115115
# ERR wrong number of arguments for 'AI.DAGRUN' command
116116
try:
117-
command = "AI.DAGRUNRO "
117+
command = "AI.DAGRUN_RO "
118118

119119
ret = con.execute_command(command)
120120
except Exception as e:
121121
exception = e
122122
env.assertEqual(type(exception), redis.exceptions.ResponseError)
123-
env.assertEqual("wrong number of arguments for 'AI.DAGRUNRO' command",exception.__str__())
123+
env.assertEqual("wrong number of arguments for 'AI.DAGRUN_RO' command",exception.__str__())
124124

125125
# ERR invalid or negative value found in number of keys to LOAD
126126
try:
127-
command = "AI.DAGRUNRO LOAD notnumber |> "\
127+
command = "AI.DAGRUN_RO LOAD notnumber |> "\
128128
"AI.TENSORSET tensor1 FLOAT 1 2 VALUES 5 10"
129129

130130
ret = con.execute_command(command)
@@ -185,7 +185,7 @@ def test_dag_local_tensorset(env):
185185
def test_dagro_local_tensorset(env):
186186
con = env.getConnection()
187187

188-
command = "AI.DAGRUNRO "\
188+
command = "AI.DAGRUN_RO "\
189189
"AI.TENSORSET volatile_tensor1 FLOAT 1 2 VALUES 5 10 |> "\
190190
"AI.TENSORSET volatile_tensor2 FLOAT 1 2 VALUES 5 10 "
191191

@@ -218,7 +218,7 @@ def test_dag_local_tensorset_persist(env):
218218
def test_dagro_local_tensorset_persist(env):
219219
con = env.getConnection()
220220

221-
command = "AI.DAGRUNRO "\
221+
command = "AI.DAGRUN_RO "\
222222
"PERSIST 1 tensor1 |> "\
223223
"AI.TENSORSET tensor1 FLOAT 1 2 VALUES 5 10"
224224

@@ -355,7 +355,7 @@ def test_dagro_keyspace_tensorget(env):
355355
"AI.TENSORSET persisted_tensor FLOAT 1 2 VALUES 5 10")
356356
env.assertEqual(ret, b'OK')
357357

358-
command = "AI.DAGRUNRO LOAD 1 persisted_tensor |> "\
358+
command = "AI.DAGRUN_RO LOAD 1 persisted_tensor |> "\
359359
"AI.TENSORGET persisted_tensor VALUES"
360360

361361
ret = con.execute_command(command)
@@ -524,7 +524,7 @@ def test_dagro_modelrun_financialNet_no_writes_multiple_modelruns(env):
524524
tensor_number = 1
525525
for transaction_tensor in creditcard_transactions:
526526
ret = con.execute_command(
527-
'AI.DAGRUNRO', 'LOAD', '1', 'referenceTensor:{}'.format(tensor_number), '|>',
527+
'AI.DAGRUN_RO', 'LOAD', '1', 'referenceTensor:{}'.format(tensor_number), '|>',
528528
'AI.TENSORSET', 'transactionTensor:{}'.format(tensor_number), 'FLOAT', 1, 30,'BLOB', transaction_tensor.tobytes(), '|>',
529529
'AI.MODELRUN', 'financialNet',
530530
'INPUTS', 'transactionTensor:{}'.format(tensor_number), 'referenceTensor:{}'.format(tensor_number),

0 commit comments

Comments
 (0)