Skip to content

Commit 9acbd90

Browse files
author
Sherin Thomas
authored
Merge pull request #46 from RedisAI/no-load-persist-dag
Fix DAGRUN with no LOAD or PERSIST
2 parents bae689c + 3dc372b commit 9acbd90

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

redisai/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def __init__(self, load, persist, executor, readonly=False, postprocess=True):
632632
self.commands += ["PERSIST", 1, persist, '|>']
633633
else:
634634
self.commands += ["PERSIST", len(persist), *persist, '|>']
635-
elif load:
635+
else:
636636
self.commands.append('|>')
637637
self.executor = executor
638638

test/test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ def test_dagrun_with_load(self):
334334
def test_dagrun_with_persist(self):
335335
con = self.get_client()
336336

337-
dag = con.dag(persist='wrongkey') # this won't raise Error
338-
dag.tensorset('a', [2, 3, 2, 3], shape=(2, 2), dtype='float').run()
337+
with self.assertRaises(ResponseError):
338+
dag = con.dag(persist='wrongkey')
339+
dag.tensorset('a', [2, 3, 2, 3], shape=(2, 2), dtype='float').run()
339340

340341
dag = con.dag(persist=['b'])
341342
dag.tensorset('a', [2, 3, 2, 3], shape=(2, 2), dtype='float')

0 commit comments

Comments
 (0)