Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch charts with GET to benefit from browser cache and conditional requests #7032

Merged
merged 91 commits into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
1ef7fb6
Sparkline dates aren't formatting in Time Series Table (#6976)
khtruong Mar 5, 2019
e7d97db
Fix the white background shown in SQL editor on drag (#7021)
xtinec Mar 13, 2019
e6886fb
Show tooltip with time frame (#6979)
betodealmeida Mar 13, 2019
b3966e4
Fix time filter control (#6978)
betodealmeida Mar 13, 2019
f4e3923
Enhancement of query context and object. (#6962)
conglei Mar 5, 2019
d7b2c3e
[fix] /superset/slice/id url is too long (#6989)
Mar 10, 2019
9855837
[WIP] fix user specified JSON metadata not updating dashboard on refr…
thunter009 Mar 14, 2019
6d0c390
feat: add ability to change font size in big number (#7003)
khtruong Mar 19, 2019
0e1a3d3
Allow LIMIT to be specified in parameters (#7052)
betodealmeida Mar 20, 2019
0c65b3f
[fix] Cursor jumping when editing chart and dashboard titles (#7038)
Mar 15, 2019
c65a166
Changing time table viz to pass formatTime a date (#7020)
michellethomas Mar 13, 2019
771d212
[db-engine-spec] Aligning Hive/Presto partition logic (#7007)
john-bodley Mar 13, 2019
fa73a8d
[fix] explore chart from dashboard missed slice title (#7046)
Mar 16, 2019
8d6e3f1
fix inaccurate data calculation with adata rolling and contribution (…
conglei Mar 14, 2019
6d0752c
Adding warning message for sqllab save query (#7028)
michellethomas Mar 18, 2019
bd2a8b5
[datasource] Ensuring consistent behavior of datasource editing/savin…
john-bodley Mar 18, 2019
81a1287
[csv-upload] Fixing message encoding (#6971)
john-bodley Mar 3, 2019
6a7d5fc
[sql-parse] Fixing LIMIT exceptions (#6963)
john-bodley Mar 5, 2019
ee85089
Adding custom control overrides (#6956)
michellethomas Mar 6, 2019
7bc3006
[sqlparse] Fixing table name extraction for ill-defined query (#7029)
john-bodley Mar 15, 2019
4ffc1b3
[missing values] Removing replacing missing values (#4905)
john-bodley Mar 21, 2019
dfc0010
[SQL Lab] Improved query and results tabs rendering reliability (#7082)
enricoberti Mar 21, 2019
98cf417
Fix filter_box migration PR #6523 (#7066)
mistercrunch Mar 21, 2019
959199d
SQL editor layout makeover (#7102)
xtinec Mar 25, 2019
b599855
[forms] Fix handling of NULLs
Mar 21, 2019
9d21f70
handle null column_name in sqla and druid models
Mar 19, 2019
bdbb354
Use metric name instead of metric in filter box (#7106)
michellethomas Mar 25, 2019
87fb2df
Bump python lib croniter to an existing version (#7132)
mistercrunch Mar 26, 2019
b7fb15f
Revert PR #6933 (#7162)
betodealmeida Mar 28, 2019
63f98dc
Add decorator for etag cache
betodealmeida Mar 6, 2019
b65dca6
Fetch charts with GET
betodealmeida Mar 13, 2019
a70a2f4
Small fixes
betodealmeida Mar 13, 2019
afabd44
Fix typo
betodealmeida Mar 13, 2019
c49dc70
Compute correct cache key; fix logging
betodealmeida Mar 13, 2019
ac07631
Check perms on cached response
betodealmeida Mar 13, 2019
ea26a75
Revert change
betodealmeida Mar 14, 2019
9d4acf7
If perms fail, return naked response
betodealmeida Mar 14, 2019
2a46132
Fix lint
betodealmeida Mar 14, 2019
c65a0dd
Compute cache key from all form data
betodealmeida Mar 15, 2019
35a7868
Pass extra_filters in GET request
betodealmeida Mar 15, 2019
4dd19e0
Fix pylint
betodealmeida Mar 15, 2019
debd5e0
Fix flake8
betodealmeida Mar 15, 2019
e49cd03
Use ETags even if no cache is set
betodealmeida Mar 17, 2019
ca65c0c
Handle adhoc filters
betodealmeida Mar 17, 2019
58c84db
Raise in debug mode
betodealmeida Mar 22, 2019
60e849b
Rename actions
betodealmeida Mar 22, 2019
a913a84
Fix integration tests
betodealmeida Mar 22, 2019
8ed131d
Do POST request on new charts
betodealmeida Mar 22, 2019
e96784a
Set extra/adhoc filters only in GET requests
betodealmeida Mar 22, 2019
3f49312
Raise if check_perms fails
betodealmeida Mar 22, 2019
532dc2e
Refactor auth
betodealmeida Mar 22, 2019
2631325
Fix flake8
betodealmeida Mar 22, 2019
7fb1931
Fix js unit tests
betodealmeida Mar 25, 2019
cc15133
Fix js unit tests that fail in lyftga
betodealmeida Mar 25, 2019
cb1e7cb
Fix js
betodealmeida Mar 25, 2019
2f97bf9
Sparkline dates aren't formatting in Time Series Table (#6976)
khtruong Mar 5, 2019
32088cc
Changing time table viz to pass formatTime a date (#7020)
michellethomas Mar 13, 2019
23dadc7
SQL editor layout makeover (#7102)
xtinec Mar 25, 2019
dc59507
Add decorator for etag cache
betodealmeida Mar 6, 2019
a745f32
Fetch charts with GET
betodealmeida Mar 13, 2019
1931441
Small fixes
betodealmeida Mar 13, 2019
ff037e5
Fix typo
betodealmeida Mar 13, 2019
6a4adb3
Compute correct cache key; fix logging
betodealmeida Mar 13, 2019
9436034
Check perms on cached response
betodealmeida Mar 13, 2019
9df4dc2
Revert change
betodealmeida Mar 14, 2019
e0fbb64
If perms fail, return naked response
betodealmeida Mar 14, 2019
c093b03
Fix lint
betodealmeida Mar 14, 2019
ef3afd2
Compute cache key from all form data
betodealmeida Mar 15, 2019
86e4b93
Pass extra_filters in GET request
betodealmeida Mar 15, 2019
68412bf
Fix pylint
betodealmeida Mar 15, 2019
69eeb1d
Fix flake8
betodealmeida Mar 15, 2019
fe8cc65
Use ETags even if no cache is set
betodealmeida Mar 17, 2019
f8200a1
Handle adhoc filters
betodealmeida Mar 17, 2019
b3c488d
Raise in debug mode
betodealmeida Mar 22, 2019
89f0192
Rename actions
betodealmeida Mar 22, 2019
3324f15
Fix integration tests
betodealmeida Mar 22, 2019
c0caac8
Do POST request on new charts
betodealmeida Mar 22, 2019
4b9ffa7
Set extra/adhoc filters only in GET requests
betodealmeida Mar 22, 2019
b75e11e
Raise if check_perms fails
betodealmeida Mar 22, 2019
96e3c9b
Refactor auth
betodealmeida Mar 22, 2019
a1fdb44
Fix flake8
betodealmeida Mar 22, 2019
d0bff86
Fix js unit tests
betodealmeida Mar 25, 2019
057b953
Fix js unit tests that fail in lyftga
betodealmeida Mar 25, 2019
7da0157
Fix js
betodealmeida Mar 25, 2019
ce17182
Merge
betodealmeida Apr 2, 2019
a364194
Fix bad merge
betodealmeida Apr 2, 2019
5e418ed
Use far future when max_age=0
betodealmeida Apr 2, 2019
407a87f
Merge
betodealmeida Apr 3, 2019
b48c57e
Merge branch 'lyft-VIZ-334' into VIZ-334
betodealmeida Apr 3, 2019
cb8cc64
Fix conflict
betodealmeida Apr 3, 2019
67e5980
Merge branch 'lyft-VIZ-334' into VIZ-334
betodealmeida Apr 3, 2019
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
2 changes: 1 addition & 1 deletion superset/assets/cypress/integration/dashboard/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default () => describe('top-level controls', () => {
.forEach((id) => {
const sliceRequest = `getJson_${id}`;
sliceRequests.push(`@${sliceRequest}`);
cy.route('POST', `/superset/explore_json/?form_data={"slice_id":${id}}`).as(sliceRequest);
cy.route('GET', `/superset/explore_json/?form_data={"slice_id":${id}}`).as(sliceRequest);

const forceRefresh = `getJson_${id}_force`;
forceRefreshRequests.push(`@${forceRefresh}`);
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/cypress/integration/dashboard/edit_mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default () => describe('edit mode', () => {
const dashboard = bootstrapData.dashboard_data;
const boxplotChartId = dashboard.slices.find(slice => (slice.form_data.viz_type === 'box_plot')).slice_id;
const boxplotRequest = `/superset/explore_json/?form_data={"slice_id":${boxplotChartId}}`;
cy.route('POST', boxplotRequest).as('boxplotRequest');
cy.route('GET', boxplotRequest).as('boxplotRequest');
});

cy.get('.dashboard-header').contains('Edit dashboard').click();
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/cypress/integration/dashboard/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default () => describe('dashboard filter', () => {
const aliases = [];

const filterRoute = `/superset/explore_json/?form_data={"slice_id":${filterId}}`;
cy.route('POST', filterRoute).as('fetchFilter');
cy.route('GET', filterRoute).as('fetchFilter');
cy.wait('@fetchFilter');
sliceIds
.filter(id => (parseInt(id, 10) !== filterId))
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/cypress/integration/dashboard/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default () => describe('load', () => {
// then define routes and create alias for each requests
slices.forEach((slice) => {
const alias = `getJson_${slice.slice_id}`;
cy.route('POST', `/superset/explore_json/?form_data={"slice_id":${slice.slice_id}}`).as(alias);
cy.route('GET', `/superset/explore_json/?form_data={"slice_id":${slice.slice_id}}`).as(alias);
aliases.push(`@${alias}`);
});
});
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/cypress/integration/dashboard/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default () => describe('save', () => {

// should have box_plot chart
const boxplotRequest = `/superset/explore_json/?form_data={"slice_id":${boxplotChartId}}`;
cy.route('POST', boxplotRequest).as('boxplotRequest');
cy.route('GET', boxplotRequest).as('boxplotRequest');
cy.wait('@boxplotRequest');
cy.get('.grid-container .box_plot').should('be.exist');

Expand Down
36 changes: 21 additions & 15 deletions superset/assets/cypress/integration/explore/control.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe('Groupby', () => {
cy.server();
cy.login();

cy.route('POST', '/superset/explore_json/**').as('getJson');
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
cy.visitChartByName('Num Births Trend');
cy.verifySliceSuccess({ waitAlias: '@getJson' });

Expand All @@ -36,15 +37,16 @@ describe('Groupby', () => {
cy.get('.VirtualizedSelectFocusedOption').click();
});
cy.get('button.query').click();
cy.verifySliceSuccess({ waitAlias: '@getJson', chartSelector: 'svg' });
cy.verifySliceSuccess({ waitAlias: '@postJson', chartSelector: 'svg' });
});
});

describe('AdhocMetrics', () => {
beforeEach(() => {
cy.login();
cy.server();
cy.route('POST', '/superset/explore_json/**').as('getJson');
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});

it('Clear metric and set simple adhoc metric', () => {
Expand Down Expand Up @@ -74,7 +76,7 @@ describe('AdhocMetrics', () => {

cy.get('button.query').click();
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@postJson',
querySubstring: metricName,
chartSelector: 'svg',
});
Expand Down Expand Up @@ -105,7 +107,7 @@ describe('AdhocMetrics', () => {

cy.get('button.query').click();
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@postJson',
querySubstring: metric,
chartSelector: 'svg',
});
Expand Down Expand Up @@ -137,7 +139,7 @@ describe('AdhocMetrics', () => {

cy.get('button.query').click();
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@postJson',
chartSelector: 'svg',
});
});
Expand All @@ -147,7 +149,8 @@ describe('AdhocFilters', () => {
beforeEach(() => {
cy.login();
cy.server();
cy.route('POST', '/superset/explore_json/**').as('getJson');
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});

it('Set simple adhoc filter', () => {
Expand Down Expand Up @@ -177,7 +180,7 @@ describe('AdhocFilters', () => {

cy.get('button.query').click();
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@postJson',
chartSelector: 'svg',
});
});
Expand Down Expand Up @@ -206,7 +209,7 @@ describe('AdhocFilters', () => {

cy.get('button.query').click();
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@postJson',
chartSelector: 'svg',
});
});
Expand All @@ -217,7 +220,8 @@ describe('Advanced analytics', () => {
beforeEach(() => {
cy.login();
cy.server();
cy.route('POST', '/superset/explore_json/**').as('getJson');
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});

it('Create custom time compare', () => {
Expand All @@ -240,7 +244,7 @@ describe('Advanced analytics', () => {
});

cy.get('button.query').click();
cy.wait('@getJson');
cy.wait('@postJson');
cy.reload();
cy.verifySliceSuccess({
waitAlias: '@getJson',
Expand All @@ -257,7 +261,8 @@ describe('Annotations', () => {
beforeEach(() => {
cy.login();
cy.server();
cy.route('POST', '/superset/explore_json/**').as('getJson');
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});

it('Create formula annotation y-axis goal line', () => {
Expand All @@ -280,7 +285,7 @@ describe('Annotations', () => {

cy.get('button.query').click();
cy.verifySliceSuccess({
waitAlias: '@getJson',
waitAlias: '@postJson',
chartSelector: 'svg',
});

Expand All @@ -292,7 +297,8 @@ describe('Time range filter', () => {
beforeEach(() => {
cy.login();
cy.server();
cy.route('POST', '/superset/explore_json/**').as('getJson');
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});

it('Defaults to the correct tab for time_range params', () => {
Expand All @@ -304,7 +310,7 @@ describe('Time range filter', () => {
};

cy.visitChartByParams(JSON.stringify(formData));
cy.verifySliceSuccess({ waitAlias: '@getJson' });
cy.verifySliceSuccess({ waitAlias: '@postJson' });

cy.get('[data-test=time_range]').within(() => {
cy.get('span.label').click();
Expand Down
9 changes: 5 additions & 4 deletions superset/assets/cypress/integration/explore/link.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ describe('Test explore links', () => {
beforeEach(() => {
cy.login();
cy.server();
cy.route('POST', '/superset/explore_json/**').as('getJson');
cy.route('GET', '/superset/explore_json/**').as('getJson');
cy.route('POST', '/superset/explore_json/**').as('postJson');
});

it('Open and close view query modal', () => {
Expand All @@ -35,7 +36,7 @@ describe('Test explore links', () => {

cy.get('button#query').click();
cy.get('span').contains('View query').parent().click();
cy.wait('@getJson').then(() => {
cy.wait('@postJson').then(() => {
cy.get('code');
});
cy.get('.modal-header').within(() => {
Expand Down Expand Up @@ -83,7 +84,7 @@ describe('Test explore links', () => {
const newChartName = 'Test chart';

cy.visitChartByParams(JSON.stringify(formData));
cy.verifySliceSuccess({ waitAlias: '@getJson' });
cy.verifySliceSuccess({ waitAlias: '@postJson' });
cy.url().then((url) => {
cy.get('button[data-target="#save_modal"]').click();
cy.get('.modal-content').within(() => {
Expand All @@ -109,7 +110,7 @@ describe('Test explore links', () => {
cy.get('.modal-content').within(() => {
cy.get('button#btn_modal_save').click();
});
cy.verifySliceSuccess({ waitAlias: '@getJson' });
cy.verifySliceSuccess({ waitAlias: '@postJson' });
cy.request(`/chart/api/read?_flt_3_slice_name=${chartName}`).then((response) => {
cy.request('DELETE', `/chart/api/delete/${response.body.pks[0]}`);
});
Expand Down
Loading