Open izmalk opened 8 months ago
The exception here says nothing about the syntax expected.
Could you re-run it with the transaction.logic
-> transaction.native_object
rename and post the syntax error (if it happens).
The exception here says nothing about the syntax expected. Could you re-run it with the
transaction.logic
->transaction.native_object
rename and post the syntax error (if it happens).
Thanks for noticing, I updated the error for the correct one.
I tried the same approach with Rust driver and got the following error:
Error: TypeQL(Error { errors: [TypeQLError::SyntaxErrorDetailed { message: "[TQL03] TypeQL Error: There is a syntax error near line 1:\n--> $u isa user, has email $e; $e contains '@vaticle.com';", error_line_nr: 1, formatted_error: "--> $u isa user, has email $e; $e contains '@vaticle.com';" }] })
Description
The
put_rule()
method takes three arguments: the rule's label, condition, and conclusion. All three are strings. For some reason, the condition must be enveloped in curly brackets, and a conclusion must be without a tailing semicolon.Environment
Reproducible Steps
Set up
Execute
It produces the following error if no curly brackets around Condition or the tailing semicolon in the Conclusion are present:
See error
``` Traceback (most recent call last): File "/Users/vladimir/Documents/GitHub/python_features_code_test/venv/lib/python3.11/site-packages/typedb/common/promise.py", line 66, in resolve return self.inner() ^^^^^^^^^^^^ File "/Users/vladimir/Documents/GitHub/python_features_code_test/venv/lib/python3.11/site-packages/typedb/common/promise.py", line 46, in inner if _res := raw(): ^^^^^ File "/Users/vladimir/Documents/GitHub/python_features_code_test/venv/lib/python3.11/site-packages/typedb/logic/logic_manager.py", line 70, inExpected result
I think it should work with a valid TypeQL string: no curly brackets are required (other than for a Disjunction/Negation) in Condition, and a tailing semicolon should be mandatory at the end of the Conclusion.
Additional information
transaction.logic
withtransaction.native_object
inrule.py
line 72: