Compare commits

...

9 Commits

Author SHA1 Message Date
Ville Brofeldt
87dce0c759 fix(viz): improve dtype inference logic (#12933) 2021-02-04 21:07:34 +02:00
Jesse Yang
58392f4ba4 test: fix table chart sort order E2E tests (#12936)
* test: fix table chart sort order E2E tests

* Upgrade npm packages
2021-02-04 21:07:08 +02:00
Victor Malai
44f0b022a6 Add row limit control for timeseries table (#12887) 2021-02-04 21:06:41 +02:00
Ville Brofeldt
9c9c725883 fix(viz): bump table viz to fix ordering bug (#12930) 2021-02-04 21:06:03 +02:00
Rob DiCiuccio
af439cc4b3 Bump jinja2 to latest version (#12901) 2021-02-04 21:05:29 +02:00
Jesse Yang
7be6a727d1 fix(chart): allow null for most query object props (#12905) 2021-02-04 21:04:48 +02:00
Ricardo Gândara Pinto
6c83bb74aa fix: Presto column_type_mappings time and timestamp (#12861)
* Fix presto column_type_mappings time and timestamp

* Added unit tests
2021-02-02 19:43:10 +02:00
Ville Brofeldt
243124b984 fix(explore): missing select when groupby without metrics (#12890) 2021-02-02 19:42:50 +02:00
Jesse Yang
e9ba074bcc chore: bump superset-ui packages to v0.17.2 and v0.17.3 (#12854)
* chore: bump superset-ui packages to v0.17.2 and v0.17.3

* Bump also the nvd3 chart
2021-02-02 19:42:15 +02:00
13 changed files with 281 additions and 304 deletions

View File

@@ -53,7 +53,7 @@ idna==2.10 # via email-validator, yarl
importlib-metadata==2.1.1 # via -r requirements/base.in, jsonschema, kombu, markdown
isodate==0.6.0 # via apache-superset
itsdangerous==1.1.0 # via flask, flask-wtf
jinja2==2.11.2 # via flask, flask-babel
jinja2==2.11.3 # via flask, flask-babel
jsonschema==3.2.0 # via flask-appbuilder
kombu==4.6.11 # via celery
korean-lunar-calendar==0.2.1 # via holidays

View File

@@ -115,15 +115,18 @@ describe('Visualization > Table', () => {
metrics: [NUM_METRIC, MAX_DS],
groupby: ['name'],
});
cy.verifySliceSuccess({
waitAlias: '@chartData',
querySubstring: /group by.*name/i,
chartSelector: 'table',
cy.wait('@chartData').then(({ response }) => {
cy.verifySliceContainer('table');
const records = response?.body.result[0].data;
// should sort by first metric when no sort by metric is set
expect(records[0][NUM_METRIC.label]).greaterThan(
records[1][NUM_METRIC.label],
);
});
// should handle sorting correctly
// should handle frontend sorting correctly
cy.get('.chart-container th').contains('name').click();
cy.get('.chart-container td:nth-child(2):eq(0)').contains('Aaron');
cy.get('.chart-container td:nth-child(2):eq(0)').contains('Adam');
cy.get('.chart-container th').contains('Time').click().click();
cy.get('.chart-container td:nth-child(1):eq(0)').contains('2008');
});

View File

@@ -18552,19 +18552,19 @@
}
},
"@superset-ui/chart-controls": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.1.tgz",
"integrity": "sha512-dfJRoVH0WbG5FQ8smszVtiYLI3NvvLAQxW6HRgOqTLegiKocIIB8hjpMpGrOPxx2G0mBigAubeQowC1VOlpAZQ==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.5.tgz",
"integrity": "sha512-GRvC0JPK6XEZIr680fVE1FUdf9KvCHwLKF29aoXz9V16aQltNS53Ost+gYm9K7HESD5lfDJyol2avwxeZxdTYg==",
"requires": {
"@superset-ui/core": "0.17.1",
"@superset-ui/core": "0.17.5",
"lodash": "^4.17.15",
"prop-types": "^15.7.2"
}
},
"@superset-ui/core": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.17.1.tgz",
"integrity": "sha512-VnWhb5FjMOrAF2+PJG4WkvscmgtRnnFZBEqG+2g8TSSby2RfIrGB390Dq6abqc9SmBmjNPLj6zkzsvJZv8DsOA==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.17.5.tgz",
"integrity": "sha512-9yNsskd+4XHcEI8YVJ2+aS+kun/HQx2p7ssBggfRR5ponOHoudLtNbDLxDtO1C1l+eMabr3YpWaebGB3xQd96w==",
"requires": {
"@babel/runtime": "^7.1.2",
"@emotion/core": "^10.0.28",
@@ -18647,12 +18647,12 @@
}
},
"@superset-ui/legacy-plugin-chart-calendar": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.1.tgz",
"integrity": "sha512-v9Hh2hNdxsu3vSRtx1KjqsDhDYlCStbEQekp2+BKRH55RKitbJzbw+6GgXxA09s/6VgIxji8oEaZVYAWylzJtQ==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.5.tgz",
"integrity": "sha512-Rf5nEQ1z0lSCW6k8AqVQMifeFi6HAeXYHIFCltt/egCKYlyz3Pra8SBW/L5c0hH4mdSua9UZmKraTUd4ITsFtQ==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3-array": "^2.0.3",
"d3-selection": "^1.4.0",
"d3-tip": "^0.9.1",
@@ -18670,24 +18670,24 @@
}
},
"@superset-ui/legacy-plugin-chart-chord": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.1.tgz",
"integrity": "sha512-xJbr9oyHBOBRp1IWQn1HuLsrArJtADVk2FE6r4QZTVYCKzJoKrQTqQEfkA2roHOHfOZtlcHcD1rlOMt8KpdmDw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.5.tgz",
"integrity": "sha512-EUbnX2Hah3z353SyUWWqk19R8pIWz26nvjvO4Y6a2i/0I9ukKUGgpQlyhgIFLL4SPyRwGjdStcsFNQeoMGLheQ==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"prop-types": "^15.6.2",
"react": "^16.13.1"
}
},
"@superset-ui/legacy-plugin-chart-country-map": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.1.tgz",
"integrity": "sha512-CCJPFGp0P1lEX4W0JqcSC0Lq43gx8BSUNeE//xz+ZKc9JoERttVCKjwEyFCov6Y++iFM/EfDpg1bRS0XpJxD4A==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.5.tgz",
"integrity": "sha512-dzqTZtx1oKrKT4JFGsGAx2aEmGsx7VziDo4SUaLiq1W7W7S/ABjCq2Mu9M4NRT8lkowJq3WAEgVtMy+DzONkmg==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"d3-array": "^2.0.3",
"prop-types": "^15.6.2"
@@ -18704,34 +18704,34 @@
}
},
"@superset-ui/legacy-plugin-chart-event-flow": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.1.tgz",
"integrity": "sha512-pGuo5cVjLRJILKbE2oc7mFoWUTrOIf2ChNLHpULZZeNtpG8H3gXGA97qK+5KgXtslfv2BVi1sbR97VV9IH3gTw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.5.tgz",
"integrity": "sha512-zjC5PLRaimevhZxAAjy/oAtvKxNi0cWSwdy05p//1k/ypuVsmjws+k1SlEbB8ZZwMYBVz1WbYKy+u5uqcc+O8g==",
"requires": {
"@data-ui/event-flow": "^0.0.84",
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-force-directed": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.1.tgz",
"integrity": "sha512-F8aV/iGBeHOh+9ewE8rfpWN2J/avAvlWl1zIM/PZTMlwimVwBXj8voTWk32LVL+Cb+9DwntB5KA093r8yWHK5Q==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.5.tgz",
"integrity": "sha512-kvU0xW23aWB/QUl6JgbyGJ52b4mFhdoUo92YdKicbKsI2rcZ+VEFDwJLCmIe3oosrQID0d9fnZQ/XctqeORB1Q==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"prop-types": "^15.7.2"
}
},
"@superset-ui/legacy-plugin-chart-heatmap": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.1.tgz",
"integrity": "sha512-IlItjyVT9Y3aE3qYml+CEbGpwVrPJu68MYb5UNOp+ms5DEETRH0Z61kKvX/egCVouYznyVrxjdc8SvL8tHqQYg==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.5.tgz",
"integrity": "sha512-wsfmyyToMDWOBLrPa71RWJ4NLTzCZ/FscKVHYYyYJltpDr/PGhPeiHp2Ma5RxglMJivdBxgewONKjVjm1tloRw==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"d3-svg-legend": "^1.x",
"d3-tip": "^0.9.1",
@@ -18739,14 +18739,14 @@
}
},
"@superset-ui/legacy-plugin-chart-histogram": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.1.tgz",
"integrity": "sha512-awZCVmpXH5LCOOCktZdaj5PrPUBeAWdK/60A6n/oKufZ2x4eoXVLgBpsj3JCS73XcKu3FwhWRHLujE0pZthKhA==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.5.tgz",
"integrity": "sha512-fcLzgpjospFLfplvGbMZIX7iys5ULNabDa+CAI+9tF+e+v3ZaYWYvNo7BXJrmW1Hn9ufNwDmL2CN8J5V5qGWiA==",
"requires": {
"@data-ui/histogram": "^0.0.84",
"@data-ui/theme": "^0.0.84",
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"@vx/legend": "^0.0.198",
"@vx/responsive": "^0.0.199",
"@vx/scale": "^0.0.197",
@@ -18814,12 +18814,12 @@
}
},
"@superset-ui/legacy-plugin-chart-horizon": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.1.tgz",
"integrity": "sha512-1omJPgUSktLCqBXqDMMqb9dFfflxWGmEdl6lxVPMqqCrlRILdNCd1rdsQFsu1cN90FmZav7AMVj7SLvIHWvNnQ==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.5.tgz",
"integrity": "sha512-1rkv+sbC6VKl5f0m/CtnYRueplr+bl5lLuseZRks0DPjO5m1VUGQrWsa2wCrCui0GmAdqogdJCQVcQF3I2aZxQ==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3-array": "^2.0.3",
"d3-scale": "^3.0.1",
"prop-types": "^15.6.2"
@@ -18848,12 +18848,12 @@
}
},
"@superset-ui/legacy-plugin-chart-map-box": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.1.tgz",
"integrity": "sha512-RHI9k3ulGodGjKgX2kBF3muMyTZKCQGPXV6BbNRzV8DJCc6eGrcE1eznC0ipHiy4yBYeKHfMwcWX3jh9dCI/kg==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.5.tgz",
"integrity": "sha512-gDhmAL8qULqhHdDRRYsfMbqEmx3m3ND2sjPtFGtAZa5HOUGWqBzHtW6vAgRetO6e2EU//6EZRa/MO1KNykPm1w==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"immutable": "^3.8.2",
"mapbox-gl": "^0.53.0",
"prop-types": "^15.6.2",
@@ -18870,118 +18870,118 @@
}
},
"@superset-ui/legacy-plugin-chart-paired-t-test": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.1.tgz",
"integrity": "sha512-WExiHSMvByu8+weNJoKll82cPrhF4zNRnMGzdiYMewJ6TZLN4Ws3ZLR+b2c26BnWQFyA8qXPpsCcQzX9c9WODw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.5.tgz",
"integrity": "sha512-3MR1OsZ+NQixK5iSjTUmM5NKvNWqB3wq3h5RdS5VfpmjjiJzMqB3ntKr6jwvc+9BY/UR0ffgwMjSe7Vg3RZZIg==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"distributions": "^1.0.0",
"prop-types": "^15.6.2",
"reactable-arc": "0.15.0"
}
},
"@superset-ui/legacy-plugin-chart-parallel-coordinates": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.1.tgz",
"integrity": "sha512-v6HPEyQRKEOhVpydKzVo+HWUDNaYJhgWL/mrr/kDhT+htUPOUqtTqQZ2BsvgpTQiX4qXHUMnAOXAN7eBa4Xf3w==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.5.tgz",
"integrity": "sha512-aXlmOs8JGdaoq+3XnSMTK8Kj8YRKdgGxB54Kr3uI16aw7vgwO8iBq0YgI88+XLJqiKHAsJ57mmDrtCV9UxB7Aw==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"prop-types": "^15.7.2"
}
},
"@superset-ui/legacy-plugin-chart-partition": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.1.tgz",
"integrity": "sha512-Zx7lEjgz0N/MQBmXFrhAsjryIl7QzZc5Gi5bXEi9GYiXcDUaZJmLW0cUnJT5Maqgwt3HCtKgCDZEh/SRj+XBsQ==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.5.tgz",
"integrity": "sha512-LKtJ7+chkL9Vz0hKX0no+a/9/fa4n4fQO5CMSICwlNcxvURznhkKddYn5QD5fFjdFXM/JUv+jXEX9zniq/0KyA==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"d3-hierarchy": "^1.1.8",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-pivot-table": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.1.tgz",
"integrity": "sha512-qlXdtaKNQsMibpyJIeQUqaJTLE4Uce9Kn47t9mgB6lCLQc5c+egM9hVwB57P8tUxMBCJePQcjiRIJRnyLKjOTA==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.5.tgz",
"integrity": "sha512-7e/8J16ZIyOe006XDieOpJ5ajk4C0OGkbA7m/OaFqH7cjgpWsfM7lL4SgWtmSmn8vJlidpnIy0J1BLM9Lnh67A==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"datatables.net-bs": "^1.10.15",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-rose": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.1.tgz",
"integrity": "sha512-dQykgdgrtOTAq4ck/uZ98R8Vhv4UtercXUlNDMTsiJo5nz3/Ka/4Oz3zBf3Pey+3JrsIOQtJP1vKRKt/j37Zkg==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.5.tgz",
"integrity": "sha512-r6ztR7M6WD7BywPM5pmqlb6+exB1sUE4vIScs3h80eeAQsWtaGMevzTvkNetYv3t4vZiSvelcl1Z9OpcJgar6Q==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"nvd3": "1.8.6",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-sankey": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.1.tgz",
"integrity": "sha512-gy5COpeeEHllYFuenXwdZr5OZ8bL1g+C16bGbjACG9/kIaF9ShoTN+Ad5cNTepb78Cox+WhmPHKIzbgPybN3Bw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.5.tgz",
"integrity": "sha512-HYKbeqRfJYTiGenv36U6rcNg/gRepeEMwGTWYjevVg6UNNkR5e+/efbFeX+ypMePHRtkaYX+TIe3oAFzkpk9gw==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"d3-sankey": "^0.4.2",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-sankey-loop": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.1.tgz",
"integrity": "sha512-r46LqceZi1hv6DDiZMinuU/hR+jyAgURcBvXy/5GvEAF+0eVHUzqbQ8SWivmFCNRwVTAEBMYkUa3IKZ6LBeUbw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.5.tgz",
"integrity": "sha512-6YrhvSMSB8c7UhCVP0taLONK5dNkwxNEiGSOjuFdxqElPE/8mTPHUAPHlG+NIYECV8tcJq76/8C7V/RUIj0Hcw==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3-sankey-diagram": "^0.7.3",
"d3-selection": "^1.4.0",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-sunburst": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.1.tgz",
"integrity": "sha512-hyP36lNaLBWCKfRXTMTG/uvJZa1bMjyX0jYDRAY/tNVxPBAjhTrB76SW1eShfpugg6baaqys9XrbVkxiKRcFnA==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.5.tgz",
"integrity": "sha512-rw5QqAbx7BeHdnJDM9nYVyTHH6Yzp2hHB2C0bHXVPIBe4L2zu71s/T8vRpGqdgFpumdpo1TgZhnrNqx4fgo3yw==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-treemap": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.1.tgz",
"integrity": "sha512-z6dQo1ZDb2/drZUJ3nYScBbDXHiIYchtpscYNszyB/jGxJ90ridUniLQicyLxMkjdK4mpuBW9MgidSg0y0I0sw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.5.tgz",
"integrity": "sha512-HCv4EiKdu8NLcW4YjXcYUSKfoj+Wj+E3UIHvz9YNh3unO2fe926DohWEQO/y24xz59s1Ha4FmJuPS4cFD5bq6w==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3-hierarchy": "^1.1.8",
"d3-selection": "^1.4.0",
"prop-types": "^15.6.2"
}
},
"@superset-ui/legacy-plugin-chart-world-map": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.1.tgz",
"integrity": "sha512-S9XuCVUIbgfCH4sG0PWGMdEc14fzunZIiUZOC2hh2JtLV/vU452XO4a9viTzWFvAY75zHNetgkTtuoCsrQdLOw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.5.tgz",
"integrity": "sha512-aOJvC9uhHaJuwGWoxjB70VIG8fDljXG1skVPX7m7fjvrw2QIanv3c6mENWFYjCXjtTNjXj3XXly8d8BAv94Emw==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"d3-array": "^2.4.0",
"d3-color": "^1.4.1",
@@ -19005,13 +19005,13 @@
}
},
"@superset-ui/legacy-preset-chart-big-number": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.1.tgz",
"integrity": "sha512-961i+DqTNcPNlvH3GAB2ofViEk4CcZFdcjZ/rMdCzlEichmLLrNzKUPfouvhMpMokb4ysEADOkQvE7POlKjDWw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.5.tgz",
"integrity": "sha512-dhXXSR20ekNgzVysT0LuyKgTF9Kr8wM9tceQK/zSNdpcJu4zBPuau1wSKKNm0uuuB9KrwYTNMd4JgtgrrGDqYQ==",
"requires": {
"@data-ui/xy-chart": "^0.0.84",
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"@types/d3-color": "^1.2.2",
"@types/shortid": "^0.0.29",
"d3-color": "^1.2.3",
@@ -19044,13 +19044,13 @@
}
},
"@superset-ui/legacy-preset-chart-nvd3": {
"version": "0.16.10",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.16.10.tgz",
"integrity": "sha512-zQPybEGYfthiUpwSOV4E1YUWnSqWY6S4nGXR8rVh2FIUFzyYyr4f5ZzOr6DKmytPlQbL1oXg0m35A8boshOh0g==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.17.5.tgz",
"integrity": "sha512-0+xxCz97Yg8bA/2uN4CHrhfzSyPQViB0p1lxKVgi8S8Gd/AX3oDD3XCn84kyAFzo3aNmD27KpFfZN/GwzDJDGg==",
"requires": {
"@data-ui/xy-chart": "^0.0.84",
"@superset-ui/chart-controls": "0.16.9",
"@superset-ui/core": "0.16.7",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"d3": "^3.5.17",
"d3-tip": "^0.9.1",
"dompurify": "^2.0.6",
@@ -19061,124 +19061,28 @@
"nvd3-fork": "^2.0.5",
"prop-types": "^15.6.2",
"urijs": "^1.18.10"
},
"dependencies": {
"@superset-ui/chart-controls": {
"version": "0.16.9",
"resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.16.9.tgz",
"integrity": "sha512-GTwnJx5AhiYqwed3F3FCz+8Yuc56jlLM/g872zoHYQUejnAXGs/Iomeznga6+281DKfsbCO6ptH6qiOZYDH8PA==",
"requires": {
"@superset-ui/core": "0.16.7",
"lodash": "^4.17.15",
"prop-types": "^15.7.2"
}
},
"@superset-ui/core": {
"version": "0.16.7",
"resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.16.7.tgz",
"integrity": "sha512-9i/o9ZC+dJibhoWZnoKGvxMMFcz65LjHuYk+hRspuRWA4qwobcdu64piQpfwuFVhw1yh3cbdxq+OSsNmNX9A9g==",
"requires": {
"@babel/runtime": "^7.1.2",
"@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27",
"@types/d3-format": "^1.3.0",
"@types/d3-interpolate": "^1.3.1",
"@types/d3-scale": "^2.1.1",
"@types/d3-time": "^1.0.9",
"@types/d3-time-format": "^2.1.0",
"@types/lodash": "^4.14.149",
"@types/rison": "0.0.6",
"@types/seedrandom": "^2.4.28",
"@vx/responsive": "^0.0.197",
"csstype": "^2.6.4",
"d3-format": "^1.3.2",
"d3-interpolate": "^1.4.0",
"d3-scale": "^3.0.0",
"d3-time": "^1.0.10",
"d3-time-format": "^2.2.0",
"emotion-theming": "^10.0.27",
"fetch-retry": "^4.0.1",
"jed": "^1.1.1",
"lodash": "^4.17.11",
"pretty-ms": "^7.0.0",
"react-error-boundary": "^1.2.5",
"reselect": "^4.0.0",
"rison": "^0.1.1",
"seedrandom": "^3.0.5",
"whatwg-fetch": "^3.0.0"
}
},
"@vx/responsive": {
"version": "0.0.197",
"resolved": "https://registry.npmjs.org/@vx/responsive/-/responsive-0.0.197.tgz",
"integrity": "sha512-Qv15PJ/Hy79LjyfJ/9E8z+zacKAnD43O2Jg9wvB6PFSNs73xPEDy/mHTYxH+FZv94ruAE3scBO0330W29sQpyg==",
"requires": {
"@types/lodash": "^4.14.146",
"@types/react": "*",
"lodash": "^4.17.10",
"prop-types": "^15.6.1",
"resize-observer-polyfill": "1.5.1"
}
},
"d3-array": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/d3-array/-/d3-array-2.11.0.tgz",
"integrity": "sha512-26clcwmHQEdsLv34oNKq5Ia9tQ26Y/4HqS3dQzF42QBUqymZJ+9PORcN1G52bt37NsL2ABoX4lvyYZc+A9Y0zw==",
"requires": {
"internmap": "^1.0.0"
}
},
"d3-interpolate": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz",
"integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==",
"requires": {
"d3-color": "1"
}
},
"d3-scale": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-3.2.3.tgz",
"integrity": "sha512-8E37oWEmEzj57bHcnjPVOBS3n4jqakOeuv1EDdQSiSrYnMCBdMd3nc4HtKk7uia8DUHcY/CGuJ42xxgtEYrX0g==",
"requires": {
"d3-array": "^2.3.0",
"d3-format": "1 - 2",
"d3-interpolate": "1.2.0 - 2",
"d3-time": "1 - 2",
"d3-time-format": "2 - 3"
}
},
"d3-time-format": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-2.3.0.tgz",
"integrity": "sha512-guv6b2H37s2Uq/GefleCDtbe0XZAuy7Wa49VGkPVPMfLL9qObgBST3lEHJBMUp8S7NdLQAGIvr2KXk8Hc98iKQ==",
"requires": {
"d3-time": "1"
}
}
}
},
"@superset-ui/plugin-chart-echarts": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.1.tgz",
"integrity": "sha512-+PzvoEbeTfrZ+SkM/bldwGljTjy+VBSz/AoPsDEgKmaJ8UZSG7rXQM01X0so7XkD9WRvAMI5q6+uFjL2zfDJlw==",
"version": "0.17.6",
"resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.6.tgz",
"integrity": "sha512-C0OXO7yrkVbHhILVb8fvxbM8O/+iB6eA8NCwwOiYNJZ/HfToZGr+ebbA6uCTf/A/WWdl8Qh/lIX8vz+GJe8d/A==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@types/echarts": "^4.9.3",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"@types/mathjs": "^6.0.7",
"echarts": "^5.0.0",
"echarts": "^5.0.1",
"mathjs": "^8.0.1"
}
},
"@superset-ui/plugin-chart-table": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.1.tgz",
"integrity": "sha512-Jkf4nAU2usJUQthRMO5dSdeatlUvI+3QYCWujneTXCbR4MMBXhnlePlD0LO5dTteLNBql56rg2SbD10NDIZGZA==",
"version": "0.17.6",
"resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.6.tgz",
"integrity": "sha512-s5pfX1/AxKuiTlBOovBjI8fmMjkn2gcjxWsrhjrvo9sfeCtZ64PObTobNiKHlKrc43YLf2ZKiNY9MiWBlsT3ZA==",
"requires": {
"@emotion/core": "^10.0.28",
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"@types/d3-array": "^2.0.0",
"@types/react-table": "^7.0.19",
"d3-array": "^2.4.0",
@@ -19201,12 +19105,12 @@
}
},
"@superset-ui/plugin-chart-word-cloud": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.1.tgz",
"integrity": "sha512-jPz/22L3IwIoQqsHEFqwQTGyYdatednazPB3zGUv1KMzkj4AyU/sd5AsnCCDDC7EL10ylhy9NB8EYk12x5Z7vw==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.5.tgz",
"integrity": "sha512-jUE2RTKeLQcpKmk3ktxn7NwJOUIg7n4GCQFR0meFCJqH5TRV4E9UEfmZSo0FXhSzcUUerJSyfmXdxtzcCQMC3Q==",
"requires": {
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"@types/d3-cloud": "^1.2.1",
"@types/d3-scale": "^2.0.2",
"d3-cloud": "^1.2.5",
@@ -19238,14 +19142,14 @@
}
},
"@superset-ui/preset-chart-xy": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.1.tgz",
"integrity": "sha512-N1mSF8OE04n+xM8Fh6ZsNLD1ARGnVlh3zzld1YmhasS7rRP8UZ3STGEjLm4IV8mTYeVc+i7+Xg/VI5Fl42Uhow==",
"version": "0.17.5",
"resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.5.tgz",
"integrity": "sha512-hFPVjc7IfgFEmh3Vqt2OYGawbRu1hdbQzo/Q/p0u9Q1lKdW6TNXBkATEKTBSTbVqFxgQSGktalAW3gzlpYKK/A==",
"requires": {
"@data-ui/theme": "^0.0.84",
"@data-ui/xy-chart": "^0.0.84",
"@superset-ui/chart-controls": "0.17.1",
"@superset-ui/core": "0.17.1",
"@superset-ui/chart-controls": "0.17.5",
"@superset-ui/core": "0.17.5",
"@vx/axis": "^0.0.198",
"@vx/legend": "^0.0.198",
"@vx/scale": "^0.0.197",
@@ -20912,14 +20816,6 @@
"@types/node": "*"
}
},
"@types/echarts": {
"version": "4.9.3",
"resolved": "https://registry.npmjs.org/@types/echarts/-/echarts-4.9.3.tgz",
"integrity": "sha512-CbgZUYdLy1G2BhCI6maBwVXmrqIx/D8KwUccMXQ9W2uyXNMjBvpIRXSs+UaBtvUihPV2f0g7LGj/yua1iY0VbQ==",
"requires": {
"@types/zrender": "*"
}
},
"@types/enzyme": {
"version": "3.10.5",
"resolved": "https://registry.npmjs.org/@types/enzyme/-/enzyme-3.10.5.tgz",
@@ -20995,7 +20891,6 @@
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz",
"integrity": "sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==",
"dev": true,
"requires": {
"@types/react": "*",
"hoist-non-react-statics": "^3.3.0"
@@ -21616,11 +21511,6 @@
"integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==",
"dev": true
},
"@types/zrender": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/zrender/-/zrender-4.0.0.tgz",
"integrity": "sha512-s89GOIeKFiod2KSqHkfd2rzx+T2DVu7ihZCBEBnhFrzvQPUmzvDSBot9Fi1DfMQm9Odg+rTqoMGC38RvrwJK2w=="
},
"@typescript-eslint/eslint-plugin": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.1.0.tgz",
@@ -39594,9 +39484,9 @@
}
},
"mathfn": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/mathfn/-/mathfn-1.1.0.tgz",
"integrity": "sha512-glxPY9PZqaoGUySN1QOVnKfnWH4Az2PnHEYMRVWUnR1RZpWTLNzdCm7RxEiEJ0SJ7G95ruF6Q2/1s/LuQnhXyg=="
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mathfn/-/mathfn-1.2.0.tgz",
"integrity": "sha512-QBcepxkFxuGk12q4G0KuNbuU3UCXhDROxWZllaNZSpBivkHl2z8qNvi7UGE/WLJt+c7GTC4jigYtur+JDL+40A=="
},
"mathjs": {
"version": "8.0.1",

View File

@@ -65,34 +65,34 @@
"@babel/runtime-corejs3": "^7.12.5",
"@data-ui/sparkline": "^0.0.84",
"@emotion/core": "^10.0.35",
"@superset-ui/chart-controls": "^0.17.1",
"@superset-ui/core": "^0.17.1",
"@superset-ui/legacy-plugin-chart-calendar": "^0.17.1",
"@superset-ui/legacy-plugin-chart-chord": "^0.17.1",
"@superset-ui/legacy-plugin-chart-country-map": "^0.17.1",
"@superset-ui/legacy-plugin-chart-event-flow": "^0.17.1",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.17.1",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.17.1",
"@superset-ui/legacy-plugin-chart-histogram": "^0.17.1",
"@superset-ui/legacy-plugin-chart-horizon": "^0.17.1",
"@superset-ui/legacy-plugin-chart-map-box": "^0.17.1",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.1",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.1",
"@superset-ui/legacy-plugin-chart-partition": "^0.17.1",
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.1",
"@superset-ui/legacy-plugin-chart-rose": "^0.17.1",
"@superset-ui/legacy-plugin-chart-sankey": "^0.17.1",
"@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.1",
"@superset-ui/legacy-plugin-chart-sunburst": "^0.17.1",
"@superset-ui/legacy-plugin-chart-treemap": "^0.17.1",
"@superset-ui/legacy-plugin-chart-world-map": "^0.17.1",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.1",
"@superset-ui/chart-controls": "^0.17.5",
"@superset-ui/core": "^0.17.5",
"@superset-ui/legacy-plugin-chart-calendar": "^0.17.5",
"@superset-ui/legacy-plugin-chart-chord": "^0.17.5",
"@superset-ui/legacy-plugin-chart-country-map": "^0.17.5",
"@superset-ui/legacy-plugin-chart-event-flow": "^0.17.5",
"@superset-ui/legacy-plugin-chart-force-directed": "^0.17.5",
"@superset-ui/legacy-plugin-chart-heatmap": "^0.17.5",
"@superset-ui/legacy-plugin-chart-histogram": "^0.17.5",
"@superset-ui/legacy-plugin-chart-horizon": "^0.17.5",
"@superset-ui/legacy-plugin-chart-map-box": "^0.17.5",
"@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.5",
"@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.5",
"@superset-ui/legacy-plugin-chart-partition": "^0.17.5",
"@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.5",
"@superset-ui/legacy-plugin-chart-rose": "^0.17.5",
"@superset-ui/legacy-plugin-chart-sankey": "^0.17.5",
"@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.5",
"@superset-ui/legacy-plugin-chart-sunburst": "^0.17.5",
"@superset-ui/legacy-plugin-chart-treemap": "^0.17.5",
"@superset-ui/legacy-plugin-chart-world-map": "^0.17.5",
"@superset-ui/legacy-preset-chart-big-number": "^0.17.5",
"@superset-ui/legacy-preset-chart-deckgl": "^0.4.1",
"@superset-ui/legacy-preset-chart-nvd3": "^0.16.10",
"@superset-ui/plugin-chart-echarts": "^0.17.1",
"@superset-ui/plugin-chart-table": "^0.17.1",
"@superset-ui/plugin-chart-word-cloud": "^0.17.1",
"@superset-ui/preset-chart-xy": "^0.17.1",
"@superset-ui/legacy-preset-chart-nvd3": "^0.17.5",
"@superset-ui/plugin-chart-echarts": "^0.17.6",
"@superset-ui/plugin-chart-table": "^0.17.6",
"@superset-ui/plugin-chart-word-cloud": "^0.17.5",
"@superset-ui/preset-chart-xy": "^0.17.5",
"@vx/responsive": "^0.0.195",
"abortcontroller-polyfill": "^1.1.9",
"antd": "^4.9.4",

View File

@@ -41,6 +41,7 @@ export default {
},
},
],
['row_limit'],
[
{
name: 'url',

View File

@@ -873,18 +873,20 @@ class ChartDataQueryObjectSchema(Schema):
)
applied_time_extras = fields.Dict(
description="A mapping of temporal extras that have been applied to the query",
required=False,
allow_none=True,
example={"__time_range": "1 year ago : now"},
)
filters = fields.List(fields.Nested(ChartDataFilterSchema), required=False)
filters = fields.List(fields.Nested(ChartDataFilterSchema), allow_none=True)
granularity = fields.String(
description="Name of temporal column used for time filtering. For legacy Druid "
"datasources this defines the time grain.",
allow_none=True,
)
granularity_sqla = fields.String(
description="Name of temporal column used for time filtering for SQL "
"datasources. This field is deprecated, use `granularity` "
"instead.",
allow_none=True,
deprecated=True,
)
groupby = fields.List(
@@ -897,9 +899,11 @@ class ChartDataQueryObjectSchema(Schema):
"references to datasource metrics (strings), or ad-hoc metrics"
"which are defined only within the query object. See "
"`ChartDataAdhocMetricSchema` for the structure of ad-hoc metrics.",
allow_none=True,
)
post_processing = fields.List(
fields.Nested(ChartDataPostProcessingOperationSchema, allow_none=True),
allow_none=True,
description="Post processing operations to be applied to the result set. "
"Operations are applied to the result set in sequential order.",
)
@@ -923,40 +927,45 @@ class ChartDataQueryObjectSchema(Schema):
"- Last X seconds/minutes/hours/days/weeks/months/years\n"
"- Next X seconds/minutes/hours/days/weeks/months/years\n",
example="Last week",
allow_none=True,
)
time_shift = fields.String(
description="A human-readable date/time string. "
"Please refer to [parsdatetime](https://github.com/bear/parsedatetime) "
"documentation for details on valid values.",
allow_none=True,
)
is_timeseries = fields.Boolean(
description="Is the `query_object` a timeseries.", required=False
description="Is the `query_object` a timeseries.", allow_none=True,
)
timeseries_limit = fields.Integer(
description="Maximum row count for timeseries queries. Default: `0`",
allow_none=True,
)
timeseries_limit_metric = fields.Raw(
description="Metric used to limit timeseries queries by.", allow_none=True,
)
row_limit = fields.Integer(
description='Maximum row count. Default: `config["ROW_LIMIT"]`',
allow_none=True,
validate=[
Range(min=1, error=_("`row_limit` must be greater than or equal to 1"))
],
)
row_offset = fields.Integer(
description="Number of rows to skip. Default: `0`",
allow_none=True,
validate=[
Range(min=0, error=_("`row_offset` must be greater than or equal to 0"))
],
)
order_desc = fields.Boolean(
description="Reverse order. Default: `false`", required=False
description="Reverse order. Default: `false`", allow_none=True,
)
extras = fields.Nested(
ChartDataExtrasSchema,
description="Extra parameters to add to the query.",
required=False,
allow_none=True,
)
columns = fields.List(
fields.String(),
@@ -967,17 +976,20 @@ class ChartDataQueryObjectSchema(Schema):
fields.List(fields.Raw()),
description="Expects a list of lists where the first element is the column "
"name which to sort by, and the second element is a boolean.",
allow_none=True,
example=[["my_col_1", False], ["my_col_2", True]],
)
where = fields.String(
description="WHERE clause to be added to queries using AND operator."
"This field is deprecated and should be passed to `extras`.",
allow_none=True,
deprecated=True,
)
having = fields.String(
description="HAVING clause to be added to aggregate queries using "
"AND operator. This field is deprecated and should be passed "
"to `extras`.",
allow_none=True,
deprecated=True,
)
having_filters = fields.List(
@@ -985,6 +997,7 @@ class ChartDataQueryObjectSchema(Schema):
description="HAVING filters to be added to legacy Druid datasource queries. "
"This field is deprecated and should be passed to `extras` "
"as `having_druid`.",
allow_none=True,
deprecated=True,
)
druid_time_origin = fields.String(

View File

@@ -181,7 +181,7 @@ class QueryContext:
status = payload["status"]
if status != utils.QueryStatus.FAILED:
payload["colnames"] = list(df.columns)
payload["coltypes"] = utils.serialize_pandas_dtypes(df.dtypes)
payload["coltypes"] = utils.extract_dataframe_dtypes(df)
payload["data"] = self.get_data(df)
del payload["df"]

View File

@@ -967,7 +967,7 @@ class SqlaTable( # pylint: disable=too-many-public-methods,too-many-instance-at
columns = columns or []
columns = [col for col in columns if col != utils.DTTM_ALIAS]
if (is_sip_38 and metrics and columns) or (not is_sip_38 and metrics):
if metrics or groupby:
# dedup columns while preserving order
columns = columns if is_sip_38 else (groupby or columns)
select_exprs = []

View File

@@ -353,8 +353,8 @@ class PrestoEngineSpec(BaseEngineSpec): # pylint: disable=too-many-public-metho
(re.compile(r"^varbinary.*", re.IGNORECASE), types.VARBINARY()),
(re.compile(r"^json.*", re.IGNORECASE), types.JSON()),
(re.compile(r"^date.*", re.IGNORECASE), types.DATE()),
(re.compile(r"^time.*", re.IGNORECASE), types.Time()),
(re.compile(r"^timestamp.*", re.IGNORECASE), types.TIMESTAMP()),
(re.compile(r"^time.*", re.IGNORECASE), types.Time()),
(re.compile(r"^interval.*", re.IGNORECASE), Interval()),
(re.compile(r"^array.*", re.IGNORECASE), Array()),
(re.compile(r"^map.*", re.IGNORECASE), Map()),

View File

@@ -74,6 +74,7 @@ from flask_appbuilder import SQLA
from flask_appbuilder.security.sqla.models import Role, User
from flask_babel import gettext as __
from flask_babel.speaklater import LazyString
from pandas.api.types import infer_dtype
from sqlalchemy import event, exc, select, Text
from sqlalchemy.dialects.mysql import MEDIUMTEXT
from sqlalchemy.engine import Connection, Engine
@@ -1401,19 +1402,29 @@ def get_column_names_from_metrics(metrics: List[Metric]) -> List[str]:
return columns
def serialize_pandas_dtypes(dtypes: List[np.dtype]) -> List[GenericDataType]:
"""Serialize pandas/numpy dtypes to JavaScript types"""
mapping = {
"object": GenericDataType.STRING,
"category": GenericDataType.STRING,
"datetime64[ns]": GenericDataType.TEMPORAL,
"int64": GenericDataType.NUMERIC,
"in32": GenericDataType.NUMERIC,
"float64": GenericDataType.NUMERIC,
"float32": GenericDataType.NUMERIC,
"bool": GenericDataType.BOOLEAN,
def extract_dataframe_dtypes(df: pd.DataFrame) -> List[GenericDataType]:
"""Serialize pandas/numpy dtypes to generic types"""
# omitting string types as those will be the default type
inferred_type_map: Dict[str, GenericDataType] = {
"floating": GenericDataType.NUMERIC,
"integer": GenericDataType.NUMERIC,
"mixed-integer-float": GenericDataType.NUMERIC,
"decimal": GenericDataType.NUMERIC,
"boolean": GenericDataType.BOOLEAN,
"datetime64": GenericDataType.TEMPORAL,
"datetime": GenericDataType.TEMPORAL,
"date": GenericDataType.TEMPORAL,
}
return [mapping.get(str(x), GenericDataType.STRING) for x in dtypes]
generic_types: List[GenericDataType] = []
for column in df.columns:
series = df[column]
inferred_type = infer_dtype(series)
generic_type = inferred_type_map.get(inferred_type, GenericDataType.STRING)
generic_types.append(generic_type)
return generic_types
def indexed(

View File

@@ -554,6 +554,12 @@ class TestPrestoDbEngineSpec(TestDbEngineSpec):
sqla_type = PrestoEngineSpec.get_sqla_column_type("integer")
assert isinstance(sqla_type, types.Integer)
sqla_type = PrestoEngineSpec.get_sqla_column_type("time")
assert isinstance(sqla_type, types.Time)
sqla_type = PrestoEngineSpec.get_sqla_column_type("timestamp")
assert isinstance(sqla_type, types.TIMESTAMP)
sqla_type = PrestoEngineSpec.get_sqla_column_type(None)
assert sqla_type is None

View File

@@ -18,6 +18,8 @@ import pytest
from superset import db
from superset.charts.schemas import ChartDataQueryContextSchema
from superset.common.query_context import QueryContext
from superset.common.query_object import QueryObject
from superset.connectors.connector_registry import ConnectorRegistry
from superset.extensions import cache_manager
from superset.models.cache import CacheKey
@@ -126,6 +128,22 @@ class TestQueryContext(SupersetTestCase):
# the new cache_key should be different due to updated datasource
self.assertNotEqual(cache_key_original, cache_key_new)
def test_query_cache_key_does_not_change_for_non_existent_or_null(self):
self.login(username="admin")
payload = get_query_context("birth_names", add_postprocessing_operations=True)
del payload["queries"][0]["granularity"]
# construct baseline query_cache_key from query_context with post processing operation
query_context: QueryContext = ChartDataQueryContextSchema().load(payload)
query_object: QueryObject = query_context.queries[0]
cache_key_original = query_context.query_cache_key(query_object)
payload["queries"][0]["granularity"] = None
query_context = ChartDataQueryContextSchema().load(payload)
query_object = query_context.queries[0]
assert query_context.query_cache_key(query_object) == cache_key_original
def test_query_cache_key_changes_when_post_processing_is_updated(self):
self.login(username="admin")
payload = get_query_context("birth_names", add_postprocessing_operations=True)

View File

@@ -23,10 +23,12 @@ import hashlib
import json
import os
import re
from typing import Any, Tuple, List
from unittest.mock import Mock, patch
from tests.fixtures.birth_names_dashboard import load_birth_names_dashboard_with_slices
import numpy
import numpy as np
import pandas as pd
import pytest
from flask import Flask, g
import marshmallow
@@ -44,6 +46,7 @@ from superset.utils.core import (
convert_legacy_filters_into_adhoc,
create_ssl_cert_file,
format_timedelta,
GenericDataType,
get_form_data_token,
get_iterable,
get_email_address_list,
@@ -57,6 +60,7 @@ from superset.utils.core import (
merge_request_params,
parse_ssl_cert,
parse_js_uri_path_item,
extract_dataframe_dtypes,
split,
TimeRangeEndpoint,
validate_json,
@@ -113,9 +117,9 @@ class TestUtils(SupersetTestCase):
json_iso_dttm_ser("this is not a date")
def test_base_json_conv(self):
assert isinstance(base_json_conv(numpy.bool_(1)), bool) is True
assert isinstance(base_json_conv(numpy.int64(1)), int) is True
assert isinstance(base_json_conv(numpy.array([1, 2, 3])), list) is True
assert isinstance(base_json_conv(np.bool_(1)), bool) is True
assert isinstance(base_json_conv(np.int64(1)), int) is True
assert isinstance(base_json_conv(np.array([1, 2, 3])), list) is True
assert isinstance(base_json_conv(set([1])), list) is True
assert isinstance(base_json_conv(Decimal("1.0")), float) is True
assert isinstance(base_json_conv(uuid.uuid4()), str) is True
@@ -1066,3 +1070,34 @@ class TestUtils(SupersetTestCase):
assert get_form_data_token({"token": "token_abcdefg1"}) == "token_abcdefg1"
generated_token = get_form_data_token({})
assert re.match(r"^token_[a-z0-9]{8}$", generated_token) is not None
def test_extract_dataframe_dtypes(self):
cols: Tuple[Tuple[str, GenericDataType, List[Any]], ...] = (
("dt", GenericDataType.TEMPORAL, [date(2021, 2, 4), date(2021, 2, 4)]),
(
"dttm",
GenericDataType.TEMPORAL,
[datetime(2021, 2, 4, 1, 1, 1), datetime(2021, 2, 4, 1, 1, 1)],
),
("str", GenericDataType.STRING, ["foo", "foo"]),
("int", GenericDataType.NUMERIC, [1, 1]),
("float", GenericDataType.NUMERIC, [0.5, 0.5]),
("mixed-int-float", GenericDataType.NUMERIC, [0.5, 1.0]),
("bool", GenericDataType.BOOLEAN, [True, False]),
("mixed-str-int", GenericDataType.STRING, ["abc", 1.0]),
("obj", GenericDataType.STRING, [{"a": 1}, {"a": 1}]),
("dt_null", GenericDataType.TEMPORAL, [None, date(2021, 2, 4)]),
(
"dttm_null",
GenericDataType.TEMPORAL,
[None, datetime(2021, 2, 4, 1, 1, 1)],
),
("str_null", GenericDataType.STRING, [None, "foo"]),
("int_null", GenericDataType.NUMERIC, [None, 1]),
("float_null", GenericDataType.NUMERIC, [None, 0.5]),
("bool_null", GenericDataType.BOOLEAN, [None, False]),
("obj_null", GenericDataType.STRING, [None, {"a": 1}]),
)
df = pd.DataFrame(data={col[0]: col[2] for col in cols})
assert extract_dataframe_dtypes(df) == [col[1] for col in cols]