You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Surreal.patch method is currently broken due to the wrong method name being used in the request.
It is also wrongly typed, the expected input should be a list of dict, not a sole dict. And the return type should allow a single dict.
Steps to reproduce
Currently:
awaitdb.update("table:id", {"field": "value"})
surrealdb.ws.SurrealPermissionException: Method not found
After changing the Request method in Surreal.patch from "modify" to "patch":
awaitdb.update("table:id", {"field": "value"})
surrealdb.ws.SurrealPermissionException: There was a problem with the database: The JSON Patch contains invalid operations. Operations must be an array
Describe the bug
The
Surreal.patch
method is currently broken due to the wrong method name being used in the request.It is also wrongly typed, the expected input should be a list of dict, not a sole dict. And the return type should allow a single dict.
Steps to reproduce
Currently:
surrealdb.ws.SurrealPermissionException: Method not found
After changing the Request method in
Surreal.patch
from "modify" to "patch":surrealdb.ws.SurrealPermissionException: There was a problem with the database: The JSON Patch contains invalid operations. Operations must be an array
Now using an array as documented here: https://surrealdb.com/docs/surrealdb/integration/websocket#patch
Success! But typing of both the data param, and the return type, is still wrong.
Expected behaviour
data
parameter should by typed to expect an Array, e.g.List[Dict[str, Any]]
Surreal
methods #97SurrealDB version
1.3.1 for linux on x86_64
surrealdb.py version
0.3.2 (latest as of 2024-04-02)
Contact Details
Ideally in the issue itself. Otherwise: [email protected]
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: