We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5c8de5 commit 85fa1c6Copy full SHA for 85fa1c6
mpt_api_client/rql/query_builder.py
@@ -188,6 +188,11 @@ def new(
188
query.expr = expr
189
return query
190
191
+ @classmethod
192
+ def from_string(cls, query_string: str) -> Self:
193
+ """Create a new RQLQuery object from a string."""
194
+ return cls.new(expr=query_string)
195
+
196
def __len__(self) -> int:
197
if self.op == self.OP_EXPRESSION:
198
if self.expr:
tests/unit/rql/query_builder/test_rql_from_str.py
@@ -0,0 +1,9 @@
1
+from mpt_api_client import RQLQuery
2
3
4
+def test_rql_from_str():
5
+ str_query = "eq(id,ID)"
6
7
+ rql = RQLQuery.from_string(str_query)
8
9
+ assert str(rql) == str_query
0 commit comments