You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "MelikHajlawi (via GitHub)" <gi...@apache.org> on 2026/05/24 15:42:44 UTC
[I] [Bug] TableSelector silently truncates table list when DB has more tables than API page limit [superset]
MelikHajlawi opened a new issue, #40407:
URL: https://github.com/apache/superset/issues/40407
### Bug description
The `useTables` hook returns a `hasMore` flag that is `true` when the backend
has more tables than the current page response includes:
hasMore: json.count > json.result.length
However, this flag is never consumed by `TableSelector` or any other UI component.
When a database has more tables than the API page limit, users see a truncated list
with no warning, no count indicator, and no way to know that tables are missing.
### Steps to reproduce
1. Connect a database schema with 100+ tables
2. Open SQL Lab, select that database and schema
3. Observe the table dropdown — there is no indicator that the list is truncated
### Expected behavior
A helper message should appear below the table selector informing users that the
list is truncated, e.g. "Some tables are not shown. Refine your search."
### Files
- `superset-frontend/src/hooks/apiResources/tables.ts` — `hasMore` is computed
- `superset-frontend/src/components/TableSelector/index.tsx` — `hasMore` never used
```
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
--
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: notifications-unsubscribe@superset.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [Bug] TableSelector silently truncates table list when DB has more tables than API page limit [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [Bug] TableSelector silently truncates table list when DB has more tables than API page limit [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #40407: [Bug] TableSelector silently truncates table list when DB has more tables than API page limit
URL: https://github.com/apache/superset/issues/40407
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [I] [Bug] TableSelector silently truncates table list when DB has more tables than API page limit [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #40407:
URL: https://github.com/apache/superset/issues/40407#issuecomment-4594819220
Seems like a great PR to open, if you're so inclined!
--
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: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org