dosubot[bot] commented on issue #40407: URL: https://github.com/apache/superset/issues/40407#issuecomment-4529211111
<!-- Answer --> This is a valid observation. The `hasMore` flag is indeed [computed in the `useTables` hook](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/hooks/apiResources/tables.ts#L112-L115): ```typescript transformResponse: ({ json }: QueryResponse) => ({ options: json.result, hasMore: json.count > json.result.length, }), ``` And returned as part of the hook's `Data` type [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/hooks/apiResources/tables.ts#L47-L50), but the `TableSelector` component only destructures `currentData`, `isFetching`, and `refetch` — never `hasMore` [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/components/TableSelector/index.tsx#L195-L214). That said, there's an important nuance: the backend currently returns **all** tables/views for a schema without pagination [[3]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/database/tables.py#L138). There's even a [TODO in the code](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/hooks/apiResources/tables.ts#L106) acknowledging this: ```typescript // TODO: Would be nice to add pagination in a follow-up. Needs endpoint changes. ``` So in practice, `hasMore` would only be `true` if the backend *did* implement pagination — which it currently doesn't. The truncation scenario you describe would require the backend to actually impose a page limit on the tables endpoint. Right now, all tables for a given schema are returned in a single response. A fix here would involve two pieces: 1. **Backend**: Add pagination support to the tables endpoint (the TODO already calls this out) 2. **Frontend**: Consume `hasMore` in `TableSelector` to show a message like "Some tables are not shown. Refine your search." or implement infinite scroll/load-more If you'd like to contribute a PR for the frontend piece (consuming `hasMore` and showing a helper message), that would be useful groundwork for when backend pagination is eventually added. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=55ba8ecd-ba30-4dc0-96eb-d6f8922f2c71) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) -- 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]
