bito-code-review[bot] commented on PR #44452:
URL: https://github.com/apache/superset/pull/44452#issuecomment-5919495138
<!-- Bito Reply -->
The implementation correctly addresses the issue by introducing
`isServerPaginationUnsupported` to gate the `server_pagination` control based
on the `ROW_OFFSET` feature flag. This helper function checks if the datasource
is a semantic view and verifies the presence of `ROW_OFFSET` in
`semantic_view_features`, ensuring that the control is disabled with an
appropriate explanation when the capability is missing. This approach
effectively prevents the provider error by disabling the UI control for
unsupported semantic views, while allowing existing SQL datasets to maintain
their current behavior.
**superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx**
```
function isServerPaginationUnsupported({
datasource,
form_data,
}: ControlPanelState): boolean {
const isSemanticView =
datasource?.type === 'semantic_view' ||
(!datasource && form_data.datasource?.endsWith('__semantic_view'));
const features =
datasource && 'semantic_view_features' in datasource
? datasource.semantic_view_features
: undefined;
return Boolean(isSemanticView && !features?.includes('ROW_OFFSET'));
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]