Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
7a9f687
Test fork commit
nelsondrew Apr 9, 2025
1cec095
Merge branch 'master' of https://github.com/apache/superset
amaannawab923 Apr 16, 2025
696d5d9
Merge branch 'master' of https://github.com/apache/superset
amaannawab923 Apr 25, 2025
672c16f
Merge branch 'master' of https://github.com/apache/superset
amaannawab923 Apr 29, 2025
3df058e
Merge branch 'master' of https://github.com/apache/superset
amaannawab923 Apr 29, 2025
dc5820d
Merge branch 'master' of https://github.com/apache/superset
amaannawab923 May 1, 2025
60008b4
Increased Choices for Row limit
amaannawab923 May 1, 2025
833b363
Over riding sql max row to increase row limit
amaannawab923 May 1, 2025
2464666
Validator for server pagination
amaannawab923 May 1, 2025
45cceec
Validation dependancy
amaannawab923 May 1, 2025
97536bd
Simplifying validation dependncies
amaannawab923 May 2, 2025
36dee53
comments
amaannawab923 May 2, 2025
e3dd853
Merge pull request #2 from amaannawab923/feat/dependancy-check
amaannawab923 May 2, 2025
b592a56
Removing unneccessary boolean
amaannawab923 May 3, 2025
e0fe2db
Clean up
amaannawab923 May 3, 2025
492c146
Build query changes
amaannawab923 May 3, 2025
da73bd9
Config vars for table max row
amaannawab923 May 3, 2025
84608e4
Table row limit for no server pagination in flask
amaannawab923 May 3, 2025
4557079
Having server page length & row limit control on seperate lines
amaannawab923 May 3, 2025
4c925ab
Tests for validate Server pagination
amaannawab923 May 3, 2025
fdc282f
Fixing csv & json reports
amaannawab923 May 3, 2025
fcfdfee
Check for download query
amaannawab923 May 3, 2025
c4cc191
Fixing download
amaannawab923 May 3, 2025
e8205e4
Download for json
amaannawab923 May 3, 2025
266b49f
Entries per page fix
amaannawab923 May 4, 2025
0bbb8d8
New external api method
amaannawab923 May 4, 2025
25a3ad9
Sorting parameters in own state
amaannawab923 May 4, 2025
af24a79
Updating sort by
amaannawab923 May 5, 2025
34a98e1
Sorting change
amaannawab923 May 5, 2025
49aa28e
Backend driven sorting
amaannawab923 May 5, 2025
c3b8379
Seperate control for table row limit
amaannawab923 May 5, 2025
8ed6aa0
Seperation of variables for Row limit increase for table
amaannawab923 May 5, 2025
0d33d6e
Moving row limit options for table
amaannawab923 May 5, 2025
62ba43b
Cypress fix
amaannawab923 May 5, 2025
f1a1757
Using update table own state
amaannawab923 May 5, 2025
cefdd01
removing unneccessary check
amaannawab923 May 5, 2025
99315fc
Text search operator for query operations
amaannawab923 May 5, 2025
a7d6fca
Backend search basic implementation
amaannawab923 May 5, 2025
7e42ab1
Search input focus
amaannawab923 May 5, 2025
8f9ad77
Handling no results scenario for backend search
amaannawab923 May 5, 2025
d682449
Search dropdown ui
amaannawab923 May 5, 2025
37d16f9
Only string cols are allowed for search
amaannawab923 May 5, 2025
414b621
Backend search with multi select
amaannawab923 May 5, 2025
7d2ece8
Row count
amaannawab923 May 5, 2025
e576cc4
Apache header
amaannawab923 May 5, 2025
c8c49e3
update import
amaannawab923 May 5, 2025
4f09e62
Space from antd
amaannawab923 May 5, 2025
433a708
Select from antd
amaannawab923 May 5, 2025
b73c35e
cleanup
amaannawab923 May 5, 2025
bdd037d
Resolved comments
amaannawab923 May 6, 2025
cd88d05
Eliminating python var
amaannawab923 May 7, 2025
36764cc
unnecessary param
amaannawab923 May 7, 2025
529a5f2
Refactor as per comments
amaannawab923 May 7, 2025
c3c4bae
Removing text search & falling back to ilike
amaannawab923 May 7, 2025
aaf8955
Row limit cypress test
amaannawab923 May 7, 2025
ad7d346
resolve python unit test
amaannawab923 May 7, 2025
82cd78f
Update doc test
amaannawab923 May 7, 2025
887abbf
Sorting cypress
amaannawab923 May 7, 2025
cd35a4d
Cypress tests improvement
amaannawab923 May 7, 2025
4e73af5
Class name
amaannawab923 May 7, 2025
6746fe8
cleanup
amaannawab923 May 8, 2025
8c5a165
Resolved comments
amaannawab923 May 8, 2025
7a6d683
function signature
amaannawab923 May 8, 2025
7d05b61
Correcting typo
amaannawab923 May 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,215 @@ describe('Visualization > Table', () => {
});
cy.get('td').contains(/\d*%/);
});

it('Test row limit with server pagination toggle', () => {
cy.visitChartByParams({
...VIZ_DEFAULTS,
metrics: ['count'],
row_limit: 100,
});

// Enable server pagination
cy.get('[data-test="server_pagination-header"] div.pull-left').click();

// Click row limit control and select high value (200k)
cy.get('div[aria-label="Row limit"]').click();

// Type 200000 and press enter to select the option
cy.get('div[aria-label="Row limit"]')
.find('.ant-select-selection-search-input:visible')
.type('200000{enter}');

// Verify that there is no error tooltip when server pagination is enabled
cy.get('[data-test="error-tooltip"]').should('not.exist');

// Disable server pagination
cy.get('[data-test="server_pagination-header"] div.pull-left').click();

// Verify error tooltip appears
cy.get('[data-test="error-tooltip"]').should('be.visible');

// Trigger mouseover and verify tooltip text
cy.get('[data-test="error-tooltip"]').trigger('mouseover');

// Verify tooltip content
cy.get('.antd5-tooltip-inner').should('be.visible');
cy.get('.antd5-tooltip-inner').should(
'contain',
'Server pagination needs to be enabled for values over',
);

// Hide the tooltip by adding display:none style
cy.get('.antd5-tooltip').invoke('attr', 'style', 'display: none');

// Enable server pagination again
cy.get('[data-test="server_pagination-header"] div.pull-left').click();

cy.get('[data-test="error-tooltip"]').should('not.exist');

cy.get('div[aria-label="Row limit"]').click();

// Type 1000000
cy.get('div[aria-label="Row limit"]')
.find('.ant-select-selection-search-input:visible')
.type('1000000');

// Wait for 1 second
cy.wait(1000);

// Press enter
cy.get('div[aria-label="Row limit"]')
.find('.ant-select-selection-search-input:visible')
.type('{enter}');

// Wait for error tooltip to appear and verify its content
cy.get('[data-test="error-tooltip"]')
.should('be.visible')
.trigger('mouseover');

// Wait for tooltip content and verify
cy.get('.antd5-tooltip-inner').should('exist');
cy.get('.antd5-tooltip-inner').should('be.visible');

// Verify tooltip content separately
cy.get('.antd5-tooltip-inner').should('contain', 'Value cannot exceed');
});

it('Test sorting with server pagination enabled', () => {
cy.visitChartByParams({
...VIZ_DEFAULTS,
metrics: ['count'],
groupby: ['name'],
row_limit: 100000,
server_pagination: true, // Enable server pagination
});

// Wait for the initial data load
cy.wait('@chartData');

// Get the first column header (name)
cy.get('.chart-container th').contains('name').as('nameHeader');

// Click to sort ascending
cy.get('@nameHeader').click();
cy.wait('@chartData');

// Verify first row starts with 'A'
cy.get('.chart-container td:first').invoke('text').should('match', /^[Aa]/);

// Click again to sort descending
cy.get('@nameHeader').click();
cy.wait('@chartData');

// Verify first row starts with 'Z'
cy.get('.chart-container td:first').invoke('text').should('match', /^[Zz]/);

// Test numeric sorting
cy.get('.chart-container th').contains('COUNT').as('countHeader');

// Click to sort ascending by count
cy.get('@countHeader').click();
cy.wait('@chartData');

// Get first two count values and verify ascending order
cy.get('.chart-container td:nth-child(2)').then($cells => {
const first = parseFloat($cells[0].textContent || '0');
const second = parseFloat($cells[1].textContent || '0');
expect(first).to.be.at.most(second);
});

// Click again to sort descending
cy.get('@countHeader').click();
cy.wait('@chartData');

// Get first two count values and verify descending order
cy.get('.chart-container td:nth-child(2)').then($cells => {
const first = parseFloat($cells[0].textContent || '0');
const second = parseFloat($cells[1].textContent || '0');
expect(first).to.be.at.least(second);
});
});

it('Test search with server pagination enabled', () => {
cy.visitChartByParams({
...VIZ_DEFAULTS,
metrics: ['count'],
groupby: ['name', 'state'],
row_limit: 100000,
server_pagination: true,
include_search: true,
});

cy.wait('@chartData');

// Basic search test
cy.get('span.dt-global-filter input.form-control.input-sm').should(
'be.visible',
);

cy.get('span.dt-global-filter input.form-control.input-sm').type('John');

cy.wait('@chartData');

cy.get('.chart-container tbody tr').each($row => {
cy.wrap($row).contains(/John/i);
});

// Clear and test case-insensitive search
cy.get('span.dt-global-filter input.form-control.input-sm').clear();

cy.wait('@chartData');

cy.get('span.dt-global-filter input.form-control.input-sm').type('mary');

cy.wait('@chartData');

cy.get('.chart-container tbody tr').each($row => {
cy.wrap($row).contains(/Mary/i);
});

// Test special characters
cy.get('span.dt-global-filter input.form-control.input-sm').clear();

cy.get('span.dt-global-filter input.form-control.input-sm').type('Nicole');

cy.wait('@chartData');

cy.get('.chart-container tbody tr').each($row => {
cy.wrap($row).contains(/Nicole/i);
});

// Test no results
cy.get('span.dt-global-filter input.form-control.input-sm').clear();

cy.get('span.dt-global-filter input.form-control.input-sm').type('XYZ123');

cy.wait('@chartData');

cy.get('.chart-container').contains('No records found');

// Test column-specific search
cy.get('.search-select').should('be.visible');

cy.get('.search-select').click();

cy.get('.ant-select-dropdown').should('be.visible');

cy.get('.ant-select-item-option').contains('state').should('be.visible');

cy.get('.ant-select-item-option').contains('state').click();

cy.get('span.dt-global-filter input.form-control.input-sm').clear();

cy.get('span.dt-global-filter input.form-control.input-sm').type('CA');

cy.wait('@chartData');
cy.wait(1000);

cy.get('td[aria-labelledby="header-state"]').should('be.visible');

cy.get('td[aria-labelledby="header-state"]')
.first()
.should('contain', 'CA');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import { ColumnMeta, SortSeriesData, SortSeriesType } from './types';

export const DEFAULT_MAX_ROW = 100000;
export const DEFAULT_MAX_ROW_TABLE_SERVER = 500000;

// eslint-disable-next-line import/prefer-default-export
export const TIME_FILTER_LABELS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ export { default as validateNonEmpty } from './validateNonEmpty';
export { default as validateMaxValue } from './validateMaxValue';
export { default as validateMapboxStylesUrl } from './validateMapboxStylesUrl';
export { default as validateTimeComparisonRangeValues } from './validateTimeComparisonRangeValues';
export { default as validateServerPagination } from './validateServerPagination';
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* 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 { t } from '../translation';

export default function validateServerPagination(
v: unknown,
serverPagination: boolean,
max: number,
) {
if (Number(v) > +max && !serverPagination) {
return t('Server pagination needs to be enabled for values over %s', max);
}
return false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* 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 { validateServerPagination } from '@superset-ui/core';
import './setup';

test('validateServerPagination returns warning message when server pagination is disabled and value exceeds max', () => {
expect(validateServerPagination(100001, false, 100000)).toBeTruthy();
expect(validateServerPagination('150000', false, 100000)).toBeTruthy();
expect(validateServerPagination(200000, false, 100000)).toBeTruthy();
});

test('validateServerPagination returns false when server pagination is enabled', () => {
expect(validateServerPagination(100001, true, 100000)).toBeFalsy();
expect(validateServerPagination(150000, true, 100000)).toBeFalsy();
expect(validateServerPagination('200000', true, 100000)).toBeFalsy();
});

test('validateServerPagination returns false when value is below max', () => {
expect(validateServerPagination(50000, false, 100000)).toBeFalsy();
expect(validateServerPagination('75000', false, 100000)).toBeFalsy();
expect(validateServerPagination(99999, false, 100000)).toBeFalsy();
});

test('validateServerPagination handles edge cases', () => {
expect(validateServerPagination(undefined, false, 100000)).toBeFalsy();
expect(validateServerPagination(null, false, 100000)).toBeFalsy();
expect(validateServerPagination(NaN, false, 100000)).toBeFalsy();
expect(validateServerPagination('invalid', false, 100000)).toBeFalsy();
});
Loading