Objects with json columns after a summaries request provide properties as strings

Hi team, We are trying to run a summaries like: const summary = await xata.db.items.summarize({ columns: ["linkedTable.*"], summaries: {}, filter: { "anotherLinkedTable.someProperty": "someValue", }, }); the result comes as:
{
"summaries": [
{
"linkedTable": {
"prop1": null,
"prop2": "{\"propName1\":\"propValue1\",\"propName2\":\"propValue2\",\"propName3\":null}",
"xata": {
"createdAt": "2023-09-20T15:16:53.245739Z",
"updatedAt": "2023-10-03T20:24:26.884913Z",
"version": 8
}
}
}
]
}
{
"summaries": [
{
"linkedTable": {
"prop1": null,
"prop2": "{\"propName1\":\"propValue1\",\"propName2\":\"propValue2\",\"propName3\":null}",
"xata": {
"createdAt": "2023-09-20T15:16:53.245739Z",
"updatedAt": "2023-10-03T20:24:26.884913Z",
"version": 8
}
}
}
]
}
we would expect:
{
"summaries": [
{
"linkedTable": {
"prop1": null,
"prop2": {
"propName1":"propValue1",
"propName2":"propValue2",
"propName3":null
},
"xata": {
"createdAt": "2023-09-20T15:16:53.245739Z",
"updatedAt": "2023-10-03T20:24:26.884913Z",
"version": 8
}
}
}
]
}
{
"summaries": [
{
"linkedTable": {
"prop1": null,
"prop2": {
"propName1":"propValue1",
"propName2":"propValue2",
"propName3":null
},
"xata": {
"createdAt": "2023-09-20T15:16:53.245739Z",
"updatedAt": "2023-10-03T20:24:26.884913Z",
"version": 8
}
}
}
]
}
And we are getting the results but the objects we get from the linkedTable have their JSON columns coming back as a string. If we do a xata.db.linkedTable.read(linkedTable.id), we do get an object whose JSON columns are objects, and not a string.
5 Replies
tsg
tsg15mo ago
That does sound like a bug, checking with the team and will report back
Eusebio Trigo
Eusebio TrigoOP15mo ago
Any news on this topic?
kostas
kostas15mo ago
Hey Eusebio, I agree it's a bug but unfortunately we haven't fixed yet. We've added an issue for it to the client-ts public repo: https://github.com/xataio/client-ts/issues/1215 and discussing it with our SDK dev team.
Eusebio Trigo
Eusebio TrigoOP15mo ago
Oh, ok, thanks for the information. No worries, no rush. Happy to help if we can, I can provide (via DM) the workspace and the queries we've got.
kostas
kostas15mo ago
Thanks a lot for willing to help! Basic repro of the issue is pretty straightforward, be it via a native or linked column, and I agree that the JSON formatting should be respected in the response from the summarize call. We'll let you know in case the SDK dev team has any comments or requests for input
Want results from more Discord servers?
Add your server