Describe the bug
In the Python SDK surrealdb==2.0.0, subscribe_live() appears to return only the inner record payload from a live query notification, instead of returning the full notification object containing action and result.
According to the Python SDK documentation, live query notifications should contain:
{
"action": "CREATE" | "UPDATE" | "DELETE",
"result": ...
}
However, the current behavior only returns the changed record itself, so notification["action"] raises a KeyError.
Steps to reproduce
from surrealdb import Surreal
with Surreal("ws://") as db:
db.signin({
"username": "root",
"password": "secret"
})
db.use("lab", "lab")
query_uuid = db.live("person")
print("query_uuid =", query_uuid)
print("query_uuid type =", type(query_uuid))
for notification in db.subscribe_live(query_uuid):
print("raw notification =", notification)
print("notification type =", type(notification))
if isinstance(notification, dict):
print("keys =", notification.keys())
print(notification["action"])
print(notification["result"])
Expected behaviour
{
"action": "CREATE" | "UPDATE" | "DELETE",
"result": ...
}
SurrealDB version
surreal 3.0.5
surrealdb.py version
surrealdb.py==2.0.0, windows
Contact Details
No response
Is there an existing issue for this?
Code of Conduct for repository surrealdb/surrealdb.py
Describe the bug
In the Python SDK surrealdb==2.0.0, subscribe_live() appears to return only the inner record payload from a live query notification, instead of returning the full notification object containing action and result.
According to the Python SDK documentation, live query notifications should contain:
{
"action": "CREATE" | "UPDATE" | "DELETE",
"result": ...
}
However, the current behavior only returns the changed record itself, so notification["action"] raises a KeyError.
Steps to reproduce
from surrealdb import Surreal
with Surreal("ws://") as db:
db.signin({
"username": "root",
"password": "secret"
})
Expected behaviour
{
"action": "CREATE" | "UPDATE" | "DELETE",
"result": ...
}
SurrealDB version
surreal 3.0.5
surrealdb.py version
surrealdb.py==2.0.0, windows
Contact Details
No response
Is there an existing issue for this?
Code of Conduct for repository surrealdb/surrealdb.py