You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "EnxDev (via GitHub)" <gi...@apache.org> on 2026/08/18 08:49:35 UTC

[PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

EnxDev opened a new pull request, #43296:
URL: https://github.com/apache/superset/pull/43296

   ### SUMMARY
   
   In the "View as table" modal (dashboard chart menu) and the Explore results and samples panes, the row count label disappeared whenever the number of returned rows reached the selected row limit; the common case for any dataset larger
   than the limit, and precisely the situation the label's "limit reached" tooltip exists to warn about. 
   The user got a silently truncated table.
   
   Two things were wrong in `DataTableControls`:
   
   1. The label was rendered under `!onRowLimitChange || rowcount < (rowLimit ?? Infinity)`, so it unmounted at the limit (introduced in #39212).
   2. It was rendered without a `limit` prop, so `RowCountLabel`'s limit-reached state was unreachable in this pane regardless.
   
   Both are fixed: the label always renders, and it receives the limit actually applied to the result. That last part matters because `useResultsPane` slices to `Math.min(selectedRowLimit, chartRowLimit)`; passing only the dropdown mvalue would stay silent when the chart's own `row_limit` is what truncates (chart `row_limit` 100, page size 1000 → 100 rows, no warning). A new optional `effectiveRowLimit` prop carries that value through.
   
   Because the count and the selector can now both read "100 rows", the selector is prefixed with "Limit" so it reads as a control. This required exposing antd's existing `prefix` prop on the shared `Select` (one line in `AntdExposedProps`; Superset's `Select` already spreads it through to antd).
   
   The samples pane shares `TableControls` and had the same bug; it is fixed by the same change.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   - before
   <img width="1440" height="900" alt="0-dashboard" src="https://github.com/user-attachments/assets/45ca5b31-7a68-4ccf-8fb8-89f3e15ef55f" />
   - after
   <img width="1440" height="900" alt="0-dashboard" src="https://github.com/user-attachments/assets/1453c179-13b9-496d-819f-0bbebdc48451" />
   - before
   <img width="1440" height="900" alt="1-full-default-1000" src="https://github.com/user-attachments/assets/46eb5e06-f0ab-4d62-8eca-7cc3701ccecb" />
   - after
   <img width="1440" height="900" alt="1-full-default-1000" src="https://github.com/user-attachments/assets/bda52999-1f32-47d4-9614-9e36a4cc4c95" />
   - before
   <img width="900" height="675" alt="1-modal-default-1000" src="https://github.com/user-attachments/assets/814166c7-6e61-4af4-b6e5-4791f2629ea0" />
   - after
   <img width="900" height="675" alt="1-modal-default-1000" src="https://github.com/user-attachments/assets/04066da9-12b3-4d2e-a99c-cbb9f6b4dc16" />
   - before
   <img width="1440" height="900" alt="2-full-pagesize-100" src="https://github.com/user-attachments/assets/01739524-6a4b-400b-b86f-b45580b7bfea" />
   - after
   <img width="1440" height="900" alt="2-full-pagesize-100" src="https://github.com/user-attachments/assets/7aeda401-f216-4158-924a-96f992433c39" />
   - before
   <img width="900" height="675" alt="2-modal-pagesize-100" src="https://github.com/user-attachments/assets/3aefcc6b-8b5a-4859-b936-891bf7b61a25" />
   - after
   <img width="900" height="675" alt="2-modal-pagesize-100" src="https://github.com/user-attachments/assets/b24dc26d-8696-4563-a3af-5950b1daf602" />
   - before
   <img width="828" height="59" alt="3-controls-strip" src="https://github.com/user-attachments/assets/3da16a56-cc59-446d-95e8-4ef28f1afd24" />
   - after
   <img width="828" height="59" alt="3-controls-strip" src="https://github.com/user-attachments/assets/2b4b7e9d-57f6-4521-97fd-d892729e8734" />
   
   - after
   <img width="1440" height="900" alt="4-full-tooltip" src="https://github.com/user-attachments/assets/b83c8c6c-6745-49d6-9392-35d7596e766b" />
   <img width="900" height="675" alt="4-modal-tooltip" src="https://github.com/user-attachments/assets/51ac4e94-2b9d-47ec-80ba-ace61c0bca33" />
   
   - before
   https://github.com/user-attachments/assets/7ee5e298-ce05-49a2-888f-b395842db6e3
   
   - after
   https://github.com/user-attachments/assets/9a3b9656-0c4c-4668-9d5d-5dd4eaf015d6
   
   
   
   | | page size 100 |
   |---|---|
   | **Before** | selector `100 rows`, no row count label anywhere |
   | **After** | selector `Limit 100 rows`, red `100 rows` pill with the limit-reached tooltip |
   
   <!-- attach comparison-controls-zoom.png and comparison-before-after.mp4 -->
   
   ### TESTING INSTRUCTIONS
   
   1. Create a table chart over `birth_names` grouped by `name` with `SUM(num)` and `row_limit` 10000 (250 distinct names), and add it to a dashboard.
   2. Open the chart's kebab menu → **View as table**. With the default limit (1k rows) the label reads `250 rows` in its normal styling.
   3. Change the selector to **100 rows**. The table shows 100 rows, the label reads `100 rows` in red, and hovering it shows "The row limit set for the chart was reached. The chart may show partial data."
   4. Repeat in Explore's **Results** and **Samples** panes.
   
   Unit tests: `npm run test -- src/explore/components/DataTablesPane`
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43296:
URL: https://github.com/apache/superset/pull/43296#issuecomment-5401697491

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
   
   <details>
   <summary>
   Bito Usage Guide
   </summary>
   
   **Commands**
         
   Type the following command in the pull request comment and save the comment.
         
   - `/review` - Manually triggers an incremental AI Review.
   - `/review full` - Manually triggers a full AI Review.
   
   - `/pause` - Pauses automatic reviews on this pull request.
   - `/resume` - Resumes automatic reviews.
   - `/resolve` - Marks all Bito-posted review comments as resolved.
   - `/abort` - Cancels all in-progress reviews.
   
         
   Refer to the <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/available-commands" target="_blank" rel="noopener noreferrer">documentation</a> for additional commands.
         
   **Configuration**
   
   This repository uses `Superset` You can customize the agent settings <a href="https://alpha.bito.ai/home/ai-agents/code-review-agent" target="_blank" rel="noopener noreferrer">here</a> or contact your Bito workspace admin at evan@preset.io.
         
   **Documentation & Help**
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/getting-started/install-run-using-bito-cloud/create-or-customize-an-agent-instance" target="_blank" rel="noopener noreferrer">Customize agent settings</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/implementing-custom-code-review-rules" target="_blank" rel="noopener noreferrer">Review rules</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent" target="_blank" rel="noopener noreferrer">General documentation</a>
   - <a href="https://docs.bito.ai/bito-dev-agents/ai-code-review-agent/faqs" target="_blank" rel="noopener noreferrer">FAQ</a>
   
   </details>
   


-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #43296:
URL: https://github.com/apache/superset/pull/43296#issuecomment-5326065183

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/43296?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 66.65%. Comparing base ([`98136d5`](https://app.codecov.io/gh/apache/superset/commit/98136d547cca6c7d15a65495590798fcba2276f0?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`5bfc52b`](https://app.codecov.io/gh/apache/superset/commit/5bfc52b5cc73628aa80685fceaa256594f5e7231?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@           Coverage Diff           @@
   ##           master   #43296   +/-   ##
   =======================================
     Coverage   66.65%   66.65%           
   =======================================
     Files        2874     2874           
     Lines      163817   163816    -1     
     Branches    37801    37800    -1     
   =======================================
     Hits       109191   109191           
   + Misses      52487    52486    -1     
     Partials     2139     2139           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/43296/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/43296/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `73.79% <100.00%> (+<0.01%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/43296?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3861229733


##########
superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx:
##########
@@ -111,14 +113,19 @@ export const TableControls = ({
             value={rowLimit}
             onChange={onRowLimitChange}
             options={rowLimitOptions ?? []}
+            // Labelled as the applied limit to avoid a second row count next to RowCountLabel.
+            prefix={t('Limit')}
             css={css`
-              min-width: 110px;
+              min-width: 160px;
             `}
           />
         )}
-        {(!onRowLimitChange || rowcount < (rowLimit ?? Infinity)) && (
-          <RowCountLabel rowcount={rowcount} loading={isLoading} />
-        )}
+        <RowCountLabel
+          rowcount={rowcount}
+          limit={effectiveRowLimit ?? rowLimit}

Review Comment:
   The mirror of the Samples case survives here: when the pane's own page size (default 1000) is below the chart's `row_limit`, `effectiveRowLimit === rowLimit` and a full page still shows the chart copy on an untruncated chart — e.g. `row_limit: 10000` returning 5000 rows with the pane at 1000. Should the chart wording be gated on `effectiveRowLimit === chartRowLimit`? `DataTableControls.test.tsx:57` currently locks the wrong copy in.



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3845168140


##########
superset-frontend/src/explore/components/DataTablesPane/test/DataTableControls.test.tsx:
##########
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen, userEvent } from 'spec/helpers/testing-library';
+import { GenericDataType } from '@apache-superset/core/common';
+import {
+  TableControls,
+  ROW_LIMIT_OPTIONS,
+} from '../components/DataTableControls';
+import { TableControlsProps } from '../types';
+
+const setup = (overrides: Partial<TableControlsProps> = {}) =>
+  render(
+    <TableControls
+      data={[]}
+      columnNames={['name']}
+      columnTypes={[GenericDataType.String]}
+      rowcount={0}
+      onInputChange={jest.fn()}
+      isLoading={false}
+      canDownload
+      rowLimit={100}
+      rowLimitOptions={ROW_LIMIT_OPTIONS}
+      onRowLimitChange={jest.fn()}
+      {...overrides}
+    />,
+    { useRedux: true },
+  );
+
+test('shows the row count when the result fills the selected row limit', () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('100 rows');
+});
+
+test('warns that the row limit was reached when the result fills it', async () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  userEvent.hover(screen.getByTestId('row-count-label'));
+
+  expect(await screen.findByRole('tooltip')).toHaveTextContent(
+    'The row limit set for the chart was reached',
+  );
+});
+
+test('does not warn when the result is smaller than the selected row limit', () => {
+  setup({ rowcount: 42, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('42 rows');
+  userEvent.hover(screen.getByTestId('row-count-label'));
+  expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();

Review Comment:
   This assertion runs before antd's 0.1s `mouseEnterDelay`, so it passes whether or not a tooltip would render — needs `findByRole`/`await waitFor` to fail on a regression.



##########
superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx:
##########
@@ -111,14 +112,18 @@ export const TableControls = ({
             value={rowLimit}
             onChange={onRowLimitChange}
             options={rowLimitOptions ?? []}
+            // Labelled as the applied limit to avoid a second row count next to RowCountLabel.
+            prefix={t('Limit')}
             css={css`
-              min-width: 110px;
+              min-width: 160px;
             `}
           />
         )}
-        {(!onRowLimitChange || rowcount < (rowLimit ?? Infinity)) && (
-          <RowCountLabel rowcount={rowcount} loading={isLoading} />
-        )}
+        <RowCountLabel
+          rowcount={rowcount}
+          limit={effectiveRowLimit ?? rowLimit}

Review Comment:
   `SamplesPane` passes `DEFAULT_ROW_LIMIT = 100` as `rowLimit`, so any dataset with >=100 rows now shows the red pill and "The row limit set for the chart was reached" in the Samples tab — is that the intended state there?



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3846693950


##########
superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx:
##########
@@ -111,14 +112,18 @@ export const TableControls = ({
             value={rowLimit}
             onChange={onRowLimitChange}
             options={rowLimitOptions ?? []}
+            // Labelled as the applied limit to avoid a second row count next to RowCountLabel.
+            prefix={t('Limit')}
             css={css`
-              min-width: 110px;
+              min-width: 160px;
             `}
           />
         )}
-        {(!onRowLimitChange || rowcount < (rowLimit ?? Infinity)) && (
-          <RowCountLabel rowcount={rowcount} loading={isLoading} />
-        )}
+        <RowCountLabel
+          rowcount={rowcount}
+          limit={effectiveRowLimit ?? rowLimit}

Review Comment:
   No. SamplesPane's row limit is just its own page-size selector (e.g. DEFAULT_ROW_LIMIT = 100), not a chart's row_limit — there's no "chart" involved in Samples at all. Showing "The row limit set for the chart was reached. The chart may show partial data." there was a genuine copy bug. Fix: added an optional limitReachedMessage prop on RowCountLabel (and threaded through TableControlsProps) that lets a caller override the default chart wording. SamplesPane now passes its own message instead: "The sample row limit was reached. This dataset may contain more rows." SingleQueryResultPane (the real chart-results pane) doesn't pass it, so it keeps the original chart-specific copy, which is correct there.



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3829646006


##########
superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx:
##########
@@ -111,14 +112,18 @@ export const TableControls = ({
             value={rowLimit}
             onChange={onRowLimitChange}
             options={rowLimitOptions ?? []}
+            // Labelled as the applied limit to avoid a second row count next to RowCountLabel.
+            prefix={t('Limit')}
             css={css`
-              min-width: 110px;
+              min-width: 160px;
             `}
           />
         )}
-        {(!onRowLimitChange || rowcount < (rowLimit ?? Infinity)) && (
-          <RowCountLabel rowcount={rowcount} loading={isLoading} />
-        )}
+        <RowCountLabel
+          rowcount={rowcount}
+          limit={effectiveRowLimit ?? rowLimit}

Review Comment:
   `SamplesPane` passes its page size as `rowLimit` (it becomes `per_page` in `getDatasourceSamples`), so any datasource larger than the page now hits `limitReached` and shows "The row limit set for the chart was reached. The chart may show partial data." for a sample with no chart `row_limit` involved — is that copy intended there?



##########
superset-frontend/src/explore/components/DataTablesPane/test/DataTableControls.test.tsx:
##########
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen, userEvent } from 'spec/helpers/testing-library';
+import { GenericDataType } from '@apache-superset/core/common';
+import {
+  TableControls,
+  ROW_LIMIT_OPTIONS,
+} from '../components/DataTableControls';
+import { TableControlsProps } from '../types';
+
+const setup = (overrides: Partial<TableControlsProps> = {}) =>
+  render(
+    <TableControls
+      data={[]}
+      columnNames={['name']}
+      columnTypes={[GenericDataType.String]}
+      rowcount={0}
+      onInputChange={jest.fn()}
+      isLoading={false}
+      canDownload
+      rowLimit={100}
+      rowLimitOptions={ROW_LIMIT_OPTIONS}
+      onRowLimitChange={jest.fn()}
+      {...overrides}
+    />,
+    { useRedux: true },
+  );
+
+test('shows the row count when the result fills the selected row limit', () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('100 rows');
+});
+
+test('warns that the row limit was reached when the result fills it', async () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  userEvent.hover(screen.getByTestId('row-count-label'));
+
+  expect(await screen.findByRole('tooltip')).toHaveTextContent(
+    'The row limit set for the chart was reached',
+  );
+});
+
+test('does not warn when the result is smaller than the selected row limit', () => {
+  setup({ rowcount: 42, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('42 rows');
+  userEvent.hover(screen.getByTestId('row-count-label'));
+  expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();

Review Comment:
   This assertion can't fail: antd's 0.1s `mouseEnterDelay` means no tooltip is in the DOM synchronously after `hover`, so a regression that made the warning fire at `rowcount: 42, rowLimit: 100` would still pass.



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3846625168


##########
superset-frontend/src/explore/components/DataTablesPane/test/DataTableControls.test.tsx:
##########
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen, userEvent } from 'spec/helpers/testing-library';
+import { GenericDataType } from '@apache-superset/core/common';
+import {
+  TableControls,
+  ROW_LIMIT_OPTIONS,
+} from '../components/DataTableControls';
+import { TableControlsProps } from '../types';
+
+const setup = (overrides: Partial<TableControlsProps> = {}) =>
+  render(
+    <TableControls
+      data={[]}
+      columnNames={['name']}
+      columnTypes={[GenericDataType.String]}
+      rowcount={0}
+      onInputChange={jest.fn()}
+      isLoading={false}
+      canDownload
+      rowLimit={100}
+      rowLimitOptions={ROW_LIMIT_OPTIONS}
+      onRowLimitChange={jest.fn()}
+      {...overrides}
+    />,
+    { useRedux: true },
+  );
+
+test('shows the row count when the result fills the selected row limit', () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('100 rows');
+});
+
+test('warns that the row limit was reached when the result fills it', async () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  userEvent.hover(screen.getByTestId('row-count-label'));
+
+  expect(await screen.findByRole('tooltip')).toHaveTextContent(
+    'The row limit set for the chart was reached',
+  );
+});
+
+test('does not warn when the result is smaller than the selected row limit', () => {
+  setup({ rowcount: 42, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('42 rows');
+  userEvent.hover(screen.getByTestId('row-count-label'));
+  expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();

Review Comment:
   Confirmed. The test asserted tooltip absence synchronously right after hover, before antd's 0.1s mouseEnterDelay could ever show it, so it passed unconditionally regardless of the actual logic. Fixed by waiting past the delay before asserting absence. Verified the fix is actually load-bearing by temporarily forcing limitReached = true in RowCountLabel — the test failed as expected — then reverted.



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43296:
URL: https://github.com/apache/superset/pull/43296#issuecomment-5325849680

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3847727441


##########
superset-frontend/src/components/RowCountLabel/index.tsx:
##########
@@ -26,14 +26,23 @@ type RowCountLabelProps = {
   limit?: number;
   loading?: boolean;
   label?: JSX.Element;
+  // Overrides the default "chart" wording for panes (e.g. samples) where the
+  // limit reached isn't the chart's own row_limit.
+  limitReachedMessage?: React.ReactNode;

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing test for new prop</b></div>
   <div id="fix">
   
   The new `limitReachedMessage` prop lacks test coverage. Add a test that renders `RowCountLabel` with `limitReachedMessage` and verifies the custom message appears in the tooltip instead of the default translation. This aligns with [adaptive rule 6262]: tests should verify actual business logic, not just component rendering.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #e28221</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3846623474


##########
superset-frontend/src/explore/components/DataTablesPane/components/DataTableControls.tsx:
##########
@@ -111,14 +112,18 @@ export const TableControls = ({
             value={rowLimit}
             onChange={onRowLimitChange}
             options={rowLimitOptions ?? []}
+            // Labelled as the applied limit to avoid a second row count next to RowCountLabel.
+            prefix={t('Limit')}
             css={css`
-              min-width: 110px;
+              min-width: 160px;
             `}
           />
         )}
-        {(!onRowLimitChange || rowcount < (rowLimit ?? Infinity)) && (
-          <RowCountLabel rowcount={rowcount} loading={isLoading} />
-        )}
+        <RowCountLabel
+          rowcount={rowcount}
+          limit={effectiveRowLimit ?? rowLimit}

Review Comment:
   No, not intended — good catch. The Samples pane's row limit is just this pane's own page-size selector, not a chart's row_limit, so showing "The row limit set for the chart was reached. The chart may show partial data." there was wrong copy. Fixed by adding an optional limitReachedMessage override on RowCountLabel/TableControls; SamplesPane now supplies its own wording ("The sample row limit was reached. This dataset may contain more rows.") instead of the chart-specific message.



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev merged PR #43296:
URL: https://github.com/apache/superset/pull/43296


-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #43296:
URL: https://github.com/apache/superset/pull/43296#issuecomment-5451363405

   **Bito Automatic Review Skipped – PR Already Merged**<br/><br/>Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.<br/>No action is needed if you didn't intend to review it. To get a review, you can type `/review` in a comment and save it


-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on code in PR #43296:
URL: https://github.com/apache/superset/pull/43296#discussion_r3846698302


##########
superset-frontend/src/explore/components/DataTablesPane/test/DataTableControls.test.tsx:
##########
@@ -0,0 +1,83 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { render, screen, userEvent } from 'spec/helpers/testing-library';
+import { GenericDataType } from '@apache-superset/core/common';
+import {
+  TableControls,
+  ROW_LIMIT_OPTIONS,
+} from '../components/DataTableControls';
+import { TableControlsProps } from '../types';
+
+const setup = (overrides: Partial<TableControlsProps> = {}) =>
+  render(
+    <TableControls
+      data={[]}
+      columnNames={['name']}
+      columnTypes={[GenericDataType.String]}
+      rowcount={0}
+      onInputChange={jest.fn()}
+      isLoading={false}
+      canDownload
+      rowLimit={100}
+      rowLimitOptions={ROW_LIMIT_OPTIONS}
+      onRowLimitChange={jest.fn()}
+      {...overrides}
+    />,
+    { useRedux: true },
+  );
+
+test('shows the row count when the result fills the selected row limit', () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('100 rows');
+});
+
+test('warns that the row limit was reached when the result fills it', async () => {
+  setup({ rowcount: 100, rowLimit: 100 });
+
+  userEvent.hover(screen.getByTestId('row-count-label'));
+
+  expect(await screen.findByRole('tooltip')).toHaveTextContent(
+    'The row limit set for the chart was reached',
+  );
+});
+
+test('does not warn when the result is smaller than the selected row limit', () => {
+  setup({ rowcount: 42, rowLimit: 100 });
+
+  expect(screen.getByTestId('row-count-label')).toHaveTextContent('42 rows');
+  userEvent.hover(screen.getByTestId('row-count-label'));
+  expect(screen.queryByRole('tooltip')).not.toBeInTheDocument();

Review Comment:
   Correct — expect(screen.queryByRole('tooltip')).not.toBeInTheDocument() right after userEvent.hover() can't fail either way, since antd's tooltip popup never mounts synchronously regardless of whether limitReached is true or false. Fix: added await act(() => sleep(150)) after the hover to let the delay elapse before asserting absence. I verified this is load-bearing by temporarily forcing limitReached = true in RowCountLabel — the test failed as expected — then reverted.



-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on PR #43296:
URL: https://github.com/apache/superset/pull/43296#issuecomment-5400018564

   Thanks for both notes — answers below.
   
   > `SamplesPane` passes its page size as `rowLimit`... is that copy intended there? / is that the intended state there?
   
   No, not intended — good catch. The Samples pane's row limit is just this pane's own page-size selector, not a chart's `row_limit`, so showing "The row limit set for the chart was reached. The chart may show partial data." there was wrong copy. Fixed by adding an optional `limitReachedMessage` override on `RowCountLabel`/`TableControls`; `SamplesPane` now supplies its own wording ("The sample row limit was reached. This dataset may contain more rows.") instead of the chart-specific message.
   
   > This assertion can't fail... needs `findByRole`/`await waitFor` to fail on a regression.
   
   Confirmed. The test asserted tooltip absence synchronously right after `hover`, before antd's 0.1s `mouseEnterDelay` could ever show it, so it passed unconditionally regardless of the actual logic. Fixed by waiting past the delay before asserting absence. Verified the fix is actually load-bearing by temporarily forcing `limitReached = true` in `RowCountLabel` — the test failed as expected — then reverted.
   


-- 
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: [PR] fix(explore): keep the row count label visible when the row limit is reached [superset]

Posted by "EnxDev (via GitHub)" <gi...@apache.org>.
EnxDev commented on PR #43296:
URL: https://github.com/apache/superset/pull/43296#issuecomment-5339688982

   ## EnxDev's Review Agent — apache/superset#43296 · HEAD 74efbb7d
   
   **comment** — the fix is right and the removed guard is properly guarded by a new test, but the warning text it now surfaces says "the chart" in a pane that has no chart, and the samples half of the fix stops working above 1k rows.
   
   Reviewed the diff against `RowCountLabel`, `SamplesPane`, `useResultsPane`, `DrillBy/useResultsTableView` and the samples backend. Behavioral surface of dropping the `(!onRowLimitChange || rowcount < (rowLimit ?? Infinity))` guard: Results pane and Samples pane change (intended), DrillBy is unaffected (it passes neither `rowLimit` nor `effectiveRowLimit`, so `limit` stays `undefined` and no warning can trigger), and both error branches render the label exactly as before.
   
   ### 🔴 Functional
   
   - **`DataTableControls.tsx:122-126`** · _High_ — The Samples pane defaults to `rowLimit` 100 (`SamplesPane.tsx:56`) and its `rowcount` is the returned page size, so on any dataset with ≥100 rows `rowcount >= limit` is now true and the label renders red with `RowCountLabel`'s fixed tooltip: *"The row limit set for the chart was reached. The chart may show partial data."* There is no chart in the Samples pane, and the truncation came from the pane's own selector. The same mis-attribution hits Results whenever the dropdown — not the chart's `row_limit` — is the binding limit (chart `row_limit` 10000, selector 100). This message was unreachable in both panes before the PR, so it is newly user-visible, and `test/DataTableControls.test.tsx:57` currently locks it in. Add an optional `limitMessage` prop to `RowCountLabel` and pass a table-neutral string ("The row limit was reached. The table may show partial data.") from `TableControls`. **regression test:** render `TableControls
 ` with `rowcount === rowLimit` and assert the tooltip does not claim the chart's limit was reached.
   
   ### 🟡 Should-fix
   
   - **`SamplesPane.tsx:181`** — Samples still passes only `rowLimit`, and `get_limit_clause` resets any `per_page` above `SAMPLES_ROW_LIMIT` (1000, `superset/config.py:180`) back down to it (`superset/views/datasource/utils.py:47-49`). Pick 5k or 10k and the backend returns 1000 rows, `1000 >= 5000` is false, no warning — the exact silent-truncation this PR fixes for Results. The new `prefix={t('Limit')}` makes it worse by asserting an applied limit that was overridden. The samples response already carries `total_count`; `effectiveRowLimit`/truncation can be derived from it without plumbing the config to the client.
   - **`useResultsPane.tsx:239`** — The `effectiveRowLimit={effectiveRowLimit}` plumbing has no test. All five new tests drive `TableControls` directly, so deleting this line (and the `SingleQueryResultPane` pass-through) leaves CI green while restoring the "chart `row_limit` truncates silently" case the description calls out. `test/useResultsPane.test.tsx` already exists — add a case with `row_limit` below the selected limit.
   - **`test/DataTableControls.test.tsx:66`** — `queryByRole('tooltip')` runs synchronously right after `userEvent.hover`, and antd mounts the tooltip after `mouseEnterDelay`, so this passes whether or not the warning state is correct. Assert the label is not error-styled instead, or wrap in a short `waitFor`.
   
   ### 🔵 Nits
   
   - `DataTableControls.tsx:118` — `min-width: 160px` is a hardcoded dimension on a touched line; `theme.sizeUnit * 40`.
   - CI is red at HEAD but not because of this diff: `sharded-jest-tests (3)` fails on `ExploreChartHeader › Should open all data download submenu` and `playwright-tests (chromium)` on `recently-archived.spec.ts`. The code commit `5bfc52b` was fully green; both appeared only on the master-merge commit `74efbb7d`, and `ExploreChartHeader.test.tsx` passes locally on master (40/40, 70s — slow enough to lose the race on CI). Re-run rather than chase.
   
   ### 🙌 Praise
   
   - `useResultsPane.tsx:239` + `test/DataTableControls.test.tsx:69` — passing `min(selected, chart row_limit)` rather than the dropdown value is the non-obvious half of this fix, and it is the one case with a dedicated test.
   
   <!-- enxdev-review-agent:74efbb7d -->
   _Reviewed by EnxDev's Review Agent — @EnxDev · HEAD 74efbb7d._
   


-- 
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