Skip to content

Commit 4e707f2

Browse files
Fix native calls in python driver rules api (#595)
## Usage and product changes Fixes a bug which caused the delete, is_deleted and set_label methods on a Rule to fail. ## Implementation * Passes `transaction.native_object` to the native_call instead of `transaction.logic`
1 parent 37703d4 commit 4e707f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/typedb/logic/rule.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def label(self) -> str:
5757
def set_label(self, transaction: _Transaction, new_label: str) -> Promise[None]:
5858
if not new_label:
5959
raise TypeDBDriverException(MISSING_LABEL)
60-
promise = rule_set_label(transaction.logic, self.native_object, new_label)
60+
promise = rule_set_label(transaction.native_object, self.native_object, new_label)
6161
return Promise(lambda: void_promise_resolve(promise))
6262

6363
@property
@@ -69,11 +69,11 @@ def then(self) -> str:
6969
return self._then
7070

7171
def delete(self, transaction: _Transaction) -> Promise[None]:
72-
promise = rule_delete(transaction.logic, self.native_object)
72+
promise = rule_delete(transaction.native_object, self.native_object)
7373
return Promise(lambda: void_promise_resolve(promise))
7474

7575
def is_deleted(self, transaction: _Transaction) -> Promise[bool]:
76-
promise = rule_is_deleted(transaction.logic, self.native_object)
76+
promise = rule_is_deleted(transaction.native_object, self.native_object)
7777
return Promise(lambda: bool_promise_resolve(promise))
7878

7979
def __repr__(self):

0 commit comments

Comments
 (0)