-
Notifications
You must be signed in to change notification settings - Fork 560
feat: use new paginated endpoint for pivoted sql results #14845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: use new paginated endpoint for pivoted sql results #14845
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
const { groupByColumns, valuesColumns: valuesColumnsConfig } = | ||
queryHistory.pivot_configuration; | ||
|
||
// From ProjectService.pivotQueryWorkerTask | ||
return groupByColumns && groupByColumns.length > 0 | ||
? Object.values(queryHistory.pivot_values_columns ?? {}) | ||
: null; | ||
: valuesColumnsConfig.map((col) => ({ | ||
referenceField: col.reference, | ||
pivotColumnName: `${col.reference}_${col.aggregation}`, | ||
aggregation: col.aggregation, | ||
pivotValues: [], | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need this, because in the frontend a query that just aggregates results is considered a pivoted query and depends on the valuesColumns
returned by the endpoint
486fd7d
to
30c638b
Compare
03d62f9
to
d019b18
Compare
30c638b
to
199ab61
Compare
199ab61
to
688ea63
Compare
688ea63
to
2ba7882
Compare
|
d019b18
to
557cd78
Compare
7b1b0e4
to
5dfcc22
Compare
557cd
8000
78
to
41b5f35
Compare
d301f94
to
36c7bd6
Compare
36c7bd6
to
b742d6d
Compare
41b5f35
to
628eacf
Compare
b742d6d
to
264b6be
Compare
await new Promise<void>((resolve, reject) => { | ||
readStream.on('end', () => { | ||
res.end(); | ||
resolve(); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stream error event isn't being handled in this Promise wrapper. If the stream encounters an error during piping, the Promise will never resolve or reject, potentially causing the request to hang. Consider adding an error handler:
await new Promise<void>((resolve, reject) => {
readStream.on('end', () => {
res.end();
resolve();
});
readStream.on('error', (err) => {
reject(err);
});
});
This ensures proper error propagation and prevents request timeouts when stream errors occur.
await new Promise<void>((resolve, reject) => { | |
readStream.on('end', () => { | |
res.end(); | |
resolve(); | |
}); | |
}); | |
await new Promise<void>((resolve, reject) => { | |
readStream.on('end', () => { | |
res.end(); | |
resolve(); | |
}); | |
readStream.on('error', (err) => { | |
reject(err); | |
}); | |
}); |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
# [0.1632.0](0.1631.1...0.1632.0) (2025-05-19) ### Features * use new paginated endpoint for pivoted sql results ([#14845](#14845)) ([a51d70b](a51d70b))
🎉 This PR is included in version 0.1632.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Relates to: Update FE Sql tiles to use the new paginated endpoints
Closes: #14633
Description:
POST /api/v2/projects/{projectUuid}/query/sql-chart
to trigger the sql chart queryReviewer actions