mirror of
https://github.com/apache/superset.git
synced 2026-06-27 18:35:32 +00:00
Compare commits
14 Commits
chore/ci-c
...
0.35.1rc1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62c2e15a0a | ||
|
|
b5d03ccf4f | ||
|
|
16459902e0 | ||
|
|
bc196b4b15 | ||
|
|
05e2c8e71a | ||
|
|
4c2a653797 | ||
|
|
fec3dac424 | ||
|
|
391be09aa3 | ||
|
|
5cc062bc92 | ||
|
|
49d672eb34 | ||
|
|
d2cfebe6fa | ||
|
|
cc69e3ab20 | ||
|
|
59318977f1 | ||
|
|
11774262d8 |
146
CHANGELOG.md
146
CHANGELOG.md
@@ -18,6 +18,152 @@ under the License.
|
||||
-->
|
||||
## Change Log
|
||||
|
||||
### 0.35.1 (2019/11/15 13:47 +00:00)
|
||||
|
||||
- [#8457](https://github.com/apache/incubator-superset/pull/8457) [fix] Improve csv upload functionality (#8457) (@villebro)
|
||||
- [#8566](https://github.com/apache/incubator-superset/pull/8566) [druid] Fix, pydruid forced dependency (#8566) (@dpgaspar)
|
||||
- [#8558](https://github.com/apache/incubator-superset/pull/8558) bump legacy-preset-chart-nvd3 to 0.11.5 (#8558) (@nytai)
|
||||
- [#8498](https://github.com/apache/incubator-superset/pull/8498) build: bump dompurify version because of nasty xss bypass. (#8498) (@MarcusSorealheis)
|
||||
- [#8477](https://github.com/apache/incubator-superset/pull/8477) [cli] Fix, import datasources exported by UI (#8477) (@dpgaspar)
|
||||
- [#8487](https://github.com/apache/incubator-superset/pull/8487) fixing typo. (#8487) (@MarcusSorealheis)
|
||||
- [#8430](https://github.com/apache/incubator-superset/pull/8430) [pydruid] Bumping the pydruid version (#8430) (@john-bodley)
|
||||
|
||||
### 0.35.0 (2019/10/31 11:12 +00:00)
|
||||
- [#8436](https://github.com/apache/incubator-superset/pull/8436) [fix] Updating parse_human_timedelta typing (#8436) (@john-bodley)
|
||||
- [#8423](https://github.com/apache/incubator-superset/pull/8423) chore: disable another flaky cypress test (#8423) (@mistercrunch)
|
||||
- [#8331](https://github.com/apache/incubator-superset/pull/8331) Add improved typed casting to BigQuery (#8331) (@betodealmeida)
|
||||
- [#8353](https://github.com/apache/incubator-superset/pull/8353) [tests] Fix, removing deprecated function for future Python release compatibility. (#8353) (@MarcusSorealheis)
|
||||
- [#8413](https://github.com/apache/incubator-superset/pull/8413) fixed typo in installation instructions (#8413) (@francishemingway)
|
||||
- [#8409](https://github.com/apache/incubator-superset/pull/8409) [ci] Deprecate flake8 (#8409) (@john-bodley)
|
||||
- [#7702](https://github.com/apache/incubator-superset/pull/7702) [sqla] Enforcing ISO 8601 date/timestamp formats (#7702) (@john-bodley)
|
||||
- [#8370](https://github.com/apache/incubator-superset/pull/8370) [Config] Cache static resources (#8370) (@etr2460)
|
||||
- [#8367](https://github.com/apache/incubator-superset/pull/8367) [docs] CTAS on PostgreSQL needs commit to apply (#8367) (@dpgaspar)
|
||||
- [#8399](https://github.com/apache/incubator-superset/pull/8399) Update Slack invitation link (#8399) (@robdiciuccio)
|
||||
- [#8371](https://github.com/apache/incubator-superset/pull/8371) [fix] make names non-nullable (#8371) (@serenajiang)
|
||||
- [#8390](https://github.com/apache/incubator-superset/pull/8390) [form-data] Deleting obsolete Superset.get_form_data method (#8390) (@john-bodley)
|
||||
- [#8376](https://github.com/apache/incubator-superset/pull/8376) Add 0.34.1 PRs to CHANGELOG (#8376) (@villebro)
|
||||
- [#8372](https://github.com/apache/incubator-superset/pull/8372) [migration] Migrating since/until to time_range (#8372) (@john-bodley)
|
||||
- [#8374](https://github.com/apache/incubator-superset/pull/8374) [Cypress] Skip another flaky sqllab test (#8374) (@etr2460)
|
||||
- [#8369](https://github.com/apache/incubator-superset/pull/8369) Add incubating to NOTICE (#8369) (@villebro)
|
||||
- [#8368](https://github.com/apache/incubator-superset/pull/8368) [Docs] Put superset users in abc order (#8368) (@etr2460)
|
||||
- [#8365](https://github.com/apache/incubator-superset/pull/8365) Update README.md (#8365) (@christophlingg)
|
||||
- [#8332](https://github.com/apache/incubator-superset/pull/8332) Revert "[fix] make datasource names non-nullable (#8332)" (#8363) (@serenajiang)
|
||||
- [#8345](https://github.com/apache/incubator-superset/pull/8345) [dashboard] show less filter indicators (#8345) (@graceguo-supercat)
|
||||
- [#8330](https://github.com/apache/incubator-superset/pull/8330) Fix pypi link and replace gitter badge with slack (#8330) (@villebro)
|
||||
- [#7992](https://github.com/apache/incubator-superset/pull/7992) Revert "[init] Setting up cache before registering blueprints (#7992)" (#8005) (@john-bodley)
|
||||
- [#8343](https://github.com/apache/incubator-superset/pull/8343) Add support for Exasol (#8343) (@kevang)
|
||||
- [#8351](https://github.com/apache/incubator-superset/pull/8351) fix saving new sql lab queries (#8351) (@suddjian)
|
||||
- [#8350](https://github.com/apache/incubator-superset/pull/8350) Remove unused methods from Presto (#8350) (@betodealmeida)
|
||||
- [#8338](https://github.com/apache/incubator-superset/pull/8338) Fix lint in `superset/db_engine_spec` (#8338) (@willbarrett)
|
||||
- [#8332](https://github.com/apache/incubator-superset/pull/8332) [fix] make datasource names non-nullable (#8332) (@serenajiang)
|
||||
- [#8344](https://github.com/apache/incubator-superset/pull/8344) Add Fanatics to companies that use Superset (#8344) (@coderfender)
|
||||
- [#8347](https://github.com/apache/incubator-superset/pull/8347) [docs] Add Deepomatic in organization list (#8347) (@Zanoellia)
|
||||
- [#8296](https://github.com/apache/incubator-superset/pull/8296) feat: Set moment library language during app setup (#8296) (@oskarhinc)
|
||||
- [#8299](https://github.com/apache/incubator-superset/pull/8299) fix: npm audit fix bumps handlebars 4.1.2->4.3.1 (#8299) (@mistercrunch)
|
||||
- [#8175](https://github.com/apache/incubator-superset/pull/8175) [metric] Adding security for restricted metrics (#8175) (@john-bodley)
|
||||
- [#8304](https://github.com/apache/incubator-superset/pull/8304) [Presto] Handle uncaught exception in get_create_view (#8304) (@etr2460)
|
||||
- [#8305](https://github.com/apache/incubator-superset/pull/8305) [SQL Lab] Improve autocomplete (#8305) (@etr2460)
|
||||
- [#8298](https://github.com/apache/incubator-superset/pull/8298) Allow overwriting a SQLLab query that has previously been saved (#8298) (@suddjian)
|
||||
- [#8300](https://github.com/apache/incubator-superset/pull/8300) refactor: remove unused code (#8300) (@kristw)
|
||||
- [#8320](https://github.com/apache/incubator-superset/pull/8320) Update RunQueryActionButton.jsx (#8320) (@nabinkhadka)
|
||||
- [#8317](https://github.com/apache/incubator-superset/pull/8317) Adding explicit Flask session cookie options to default config (#8317) (@craig-rueda)
|
||||
- [#8239](https://github.com/apache/incubator-superset/pull/8239) [superset] Fix, missing return on error and improved query (#8239) (@dpgaspar)
|
||||
- [#8307](https://github.com/apache/incubator-superset/pull/8307) allow non-relative LOGO_TARGET_PATH (#8307) (@nytai)
|
||||
- [#8311](https://github.com/apache/incubator-superset/pull/8311) Add safaricom to companies using superset (#8311) (@mmutiso)
|
||||
- [#8309](https://github.com/apache/incubator-superset/pull/8309) Add explicit support for python 3.7 (#8309) (@villebro)
|
||||
- [#8272](https://github.com/apache/incubator-superset/pull/8272) Refine release instructions (#8272) (@villebro)
|
||||
- [#8262](https://github.com/apache/incubator-superset/pull/8262) Add commit to attempt to resolve query table lock (#8262) (@etr2460)
|
||||
- [#8282](https://github.com/apache/incubator-superset/pull/8282) chore: skip flaky SQL Lab test (#8282) (@mistercrunch)
|
||||
- [#8261](https://github.com/apache/incubator-superset/pull/8261) [migration] Stripping leading and trailing whitespace (#8261) (@john-bodley)
|
||||
- [#8256](https://github.com/apache/incubator-superset/pull/8256) [sql_json] Ensuring the request body is JSON encoded (#8256) (@john-bodley)
|
||||
- [#8240](https://github.com/apache/incubator-superset/pull/8240) [database] Improve form and API validation for invalid URI (#8240) (@dpgaspar)
|
||||
- [#8274](https://github.com/apache/incubator-superset/pull/8274) More intuitive display of negative time deltas (#8274) (#8276) (@benvdh)
|
||||
- [#8268](https://github.com/apache/incubator-superset/pull/8268) Fix no data in Presto (#8268) (@betodealmeida)
|
||||
- [#8258](https://github.com/apache/incubator-superset/pull/8258) refactor: use deck.gl plugins from npm package (#8258) (@kristw)
|
||||
- [#8138](https://github.com/apache/incubator-superset/pull/8138) [typing] add typing for superset/connectors and superset/common (#8138) (@serenajiang)
|
||||
- [#8163](https://github.com/apache/incubator-superset/pull/8163) [SQLLab] Refactor sql json endpoint (#8163) (@dpgaspar)
|
||||
- [#8257](https://github.com/apache/incubator-superset/pull/8257) Remove __row_id (#8257) (@betodealmeida)
|
||||
- [#8250](https://github.com/apache/incubator-superset/pull/8250) Update another pypi case from superset to apache-superset (#8250) (@etr2460)
|
||||
- [#8244](https://github.com/apache/incubator-superset/pull/8244) docs: reflect the pypi move from superset to apache-superset (#8244) (@mistercrunch)
|
||||
- [#8224](https://github.com/apache/incubator-superset/pull/8224) [sqllab] create query slightly earlier (#8224) (@serenajiang)
|
||||
- [#8253](https://github.com/apache/incubator-superset/pull/8253) Fix array casting (#8253) (@betodealmeida)
|
||||
- [#8243](https://github.com/apache/incubator-superset/pull/8243) Show Presto views as views, not tables (#8243) (@betodealmeida)
|
||||
- [#8251](https://github.com/apache/incubator-superset/pull/8251) Small fix for Presto dtype map (#8251) (@betodealmeida)
|
||||
- [#8246](https://github.com/apache/incubator-superset/pull/8246) Update README.md (#8246) (@MaiTiano)
|
||||
- [#8185](https://github.com/apache/incubator-superset/pull/8185) Add RegisteredLookupExtraction support to extraction function (#8185) (@1AB9502)
|
||||
- [#8213](https://github.com/apache/incubator-superset/pull/8213) Better distinction between tables and views, and show CREATE VIEW (#8213) (@betodealmeida)
|
||||
- [#8233](https://github.com/apache/incubator-superset/pull/8233) Simplify and improve `expand_data` in Presto (#8233) (@betodealmeida)
|
||||
- [#8172](https://github.com/apache/incubator-superset/pull/8172) Allow users to estimate query cost before executing it (#8172) (@betodealmeida)
|
||||
- [#8226](https://github.com/apache/incubator-superset/pull/8226) Handle int64 columns with missing data in SQL Lab (#8226) (@betodealmeida)
|
||||
- [#8222](https://github.com/apache/incubator-superset/pull/8222) refactor: prepare control panel configs for separation into plugins (#8222) (@kristw)
|
||||
- [#8221](https://github.com/apache/incubator-superset/pull/8221) fix: initialize control state for inline control config object (#8221) (@kristw)
|
||||
- [#8214](https://github.com/apache/incubator-superset/pull/8214) [talisman] Enforcing HTTP for status checks (#8214) (@john-bodley)
|
||||
- [#8173](https://github.com/apache/incubator-superset/pull/8173) feat: read control panel configs from registry (#8173) (@kristw)
|
||||
- [#8196](https://github.com/apache/incubator-superset/pull/8196) chore: fix version info (#8196) (@mistercrunch)
|
||||
- [#8212](https://github.com/apache/incubator-superset/pull/8212) fix: attempt to fix the flaky SQL Lab test (#8212) (@mistercrunch)
|
||||
- [#8210](https://github.com/apache/incubator-superset/pull/8210) Update messages.json (#8210) (@klxiang)
|
||||
- [#8166](https://github.com/apache/incubator-superset/pull/8166) [feature][dashboard] Show/hide filter indicator on the applicable charts when filter options are open/close (#8166) (@graceguo-supercat)
|
||||
- [#8206](https://github.com/apache/incubator-superset/pull/8206) Update README.md (#8206) (@garnservo)
|
||||
- [#8208](https://github.com/apache/incubator-superset/pull/8208) chore: update UPDATING.md with a 0.34.0 section (#8208) (@mistercrunch)
|
||||
- [#8034](https://github.com/apache/incubator-superset/pull/8034) [viz] Adding get_def typing (#8034) (@john-bodley)
|
||||
- [#8197](https://github.com/apache/incubator-superset/pull/8197) chore: deprecate restricted metrics (#8197) (@mistercrunch)
|
||||
- [#8198](https://github.com/apache/incubator-superset/pull/8198) Update messages.json (#8198) (@klxiang)
|
||||
- [#8204](https://github.com/apache/incubator-superset/pull/8204) change log from csv_export to data_export; fix db name in log (#8204) (@DiggidyDave)
|
||||
- [#8164](https://github.com/apache/incubator-superset/pull/8164) more detailed async error messages (#8164) (@serenajiang)
|
||||
- [#8182](https://github.com/apache/incubator-superset/pull/8182) [Config] Disable celery acks late (#8182) (@etr2460)
|
||||
- [#8038](https://github.com/apache/incubator-superset/pull/8038) Prevent 'main' database connection creation (#8038) (@mistercrunch)
|
||||
- [#8187](https://github.com/apache/incubator-superset/pull/8187) ignore formatting for <Select> (#8187) (@gbates101)
|
||||
- [#8184](https://github.com/apache/incubator-superset/pull/8184) [fix] retry stop_query on all exceptions (#8184) (@serenajiang)
|
||||
- [#8179](https://github.com/apache/incubator-superset/pull/8179) Update messages.json (#8179) (@klxiang)
|
||||
- [#8158](https://github.com/apache/incubator-superset/pull/8158) Bump cypress from 3.1.5 to 3.4.1 (#8158) (@mistercrunch)
|
||||
- [#8139](https://github.com/apache/incubator-superset/pull/8139) [sqllab] add retries for stop_query (#8139) (@serenajiang)
|
||||
- [#8143](https://github.com/apache/incubator-superset/pull/8143) [Codemod] Rename react unsafe lifecycles (#8143) (@etr2460)
|
||||
- [#8149](https://github.com/apache/incubator-superset/pull/8149) chore: remove PY3 conditional logic (#8149) (@mistercrunch)
|
||||
- [#8156](https://github.com/apache/incubator-superset/pull/8156) Forward SIGTERM signal to gunicorn (#8156) (@smacker)
|
||||
- [#8148](https://github.com/apache/incubator-superset/pull/8148) Adding explicit include for version_info.json (#8148) (@craig-rueda)
|
||||
- [#7822](https://github.com/apache/incubator-superset/pull/7822) Revert "Fix tooltips not visible for NVD3 charts on Firefox (#7822) (#7929)" (#8147) (@etr2460)
|
||||
- [#8099](https://github.com/apache/incubator-superset/pull/8099) Revert "Allow resizing width of SQL Lab left bar / editor (#8099)" (#8146) (@etr2460)
|
||||
- [#8130](https://github.com/apache/incubator-superset/pull/8130) removes unused state values and redundant presence checks (#8130) (@nytai)
|
||||
- [#8136](https://github.com/apache/incubator-superset/pull/8136) Add duration formatter for numeric data (#8136) (@villebro)
|
||||
- [#8140](https://github.com/apache/incubator-superset/pull/8140) remove unused files (#8140) (@kristw)
|
||||
- [#8135](https://github.com/apache/incubator-superset/pull/8135) [setup] use new python requires metadata key (#8135) (@dpgaspar)
|
||||
- [#8109](https://github.com/apache/incubator-superset/pull/8109) Moving towards a whitelist approach for MANIFEST.in (#8109) (@craig-rueda)
|
||||
- [#8069](https://github.com/apache/incubator-superset/pull/8069) [SQL Lab] Async query results serialization with MessagePack and PyArrow (#8069) (@robdiciuccio)
|
||||
- [#8115](https://github.com/apache/incubator-superset/pull/8115) feat: bump superset-ui dependencies to v0.12 and plugins to v0.11 (#8115) (@kristw)
|
||||
- [#8085](https://github.com/apache/incubator-superset/pull/8085) Add LogConfigurator, and add logging for CSV export (#8085) (@DiggidyDave)
|
||||
- [#8111](https://github.com/apache/incubator-superset/pull/8111) removed database deps from reqs-dev.txt and typo. (#8111) (@MarcusSorealheis)
|
||||
- [#8104](https://github.com/apache/incubator-superset/pull/8104) [logging] add query id to SQL Lab logs (#8104) (@serenajiang)
|
||||
- [#8098](https://github.com/apache/incubator-superset/pull/8098) [Hive Engine Spec] Fix latest partition logic (#8098) (@etr2460)
|
||||
- [#8099](https://github.com/apache/incubator-superset/pull/8099) Allow resizing width of SQL Lab left bar / editor (#8099) (@betodealmeida)
|
||||
- [#8106](https://github.com/apache/incubator-superset/pull/8106) Fix cache set kwargs (#8106) (@etr2460)
|
||||
- [#8105](https://github.com/apache/incubator-superset/pull/8105) Fix sqla query cache keys function (#8105) (@etr2460)
|
||||
- [#7569](https://github.com/apache/incubator-superset/pull/7569) refactor: separate vis-specific controls from centralized controls (#7569) (@felixcodes)
|
||||
- [#8100](https://github.com/apache/incubator-superset/pull/8100) docs: remove unused release instruction (#8100) (@mistercrunch)
|
||||
- [#8093](https://github.com/apache/incubator-superset/pull/8093) Move Darwin-specific JS libs to optional (#8093) (@friendzis)
|
||||
- [#8097](https://github.com/apache/incubator-superset/pull/8097) [fix] checks for stopped queries (#8097) (@serenajiang)
|
||||
- [#8087](https://github.com/apache/incubator-superset/pull/8087) fix: minor release/license related issues (#8087) (@mistercrunch)
|
||||
- [#8083](https://github.com/apache/incubator-superset/pull/8083) feat: replace table and box plot vis with new plugins (#8083) (@kristw)
|
||||
- [#8058](https://github.com/apache/incubator-superset/pull/8058) Add docstrings and typing to db_engine_specs and sql_parse (#8058) (@villebro)
|
||||
- [#7908](https://github.com/apache/incubator-superset/pull/7908) [Feature] Dashboard filter indicators (#7908) (@graceguo-supercat)
|
||||
- [#8078](https://github.com/apache/incubator-superset/pull/8078) Remove gevent installation as a separate layer (#8078) (@aspedrosa)
|
||||
- [#8067](https://github.com/apache/incubator-superset/pull/8067) remove idna req from setup.py (#8067) (@DiggidyDave)
|
||||
- [#8075](https://github.com/apache/incubator-superset/pull/8075) Move more Presto nested types behind feature flag (#8075) (@betodealmeida)
|
||||
- [#8051](https://github.com/apache/incubator-superset/pull/8051) bump a set of test-related JS libs (#8051) (@mistercrunch)
|
||||
- [#8035](https://github.com/apache/incubator-superset/pull/8035) Make package.json cross platform (#8035) (@fzzylogic)
|
||||
- [#8057](https://github.com/apache/incubator-superset/pull/8057) Adding support for filter box in annotations (#8057) (@KKcorps)
|
||||
- [#8042](https://github.com/apache/incubator-superset/pull/8042) Improve birth example dashboard (#8042) (@mistercrunch)
|
||||
- [#8040](https://github.com/apache/incubator-superset/pull/8040) [viz] Revert dropna logic for pivot tables (#8040) (@john-bodley)
|
||||
- [#8056](https://github.com/apache/incubator-superset/pull/8056) Add feature flag for Presto expand data (#8056) (@betodealmeida)
|
||||
- [#8039](https://github.com/apache/incubator-superset/pull/8039) Disable flaky cypress test (#8039) (@mistercrunch)
|
||||
- [#8045](https://github.com/apache/incubator-superset/pull/8045) Added WPSemantix to list of companies using Apache Superset in README.md file (#8045) (@semantiDan)
|
||||
- [#8032](https://github.com/apache/incubator-superset/pull/8032) Fix bug where lists in queries cannot contain multiple types (#8032) (@serenajiang)
|
||||
- [#8026](https://github.com/apache/incubator-superset/pull/8026) Two more organisations using Superset - Zalora, GFG (#8026) (@ksaagariconic)
|
||||
- [#8018](https://github.com/apache/incubator-superset/pull/8018) [Dashboard] Hide slice titles when they're empty (#8018) (@etr2460)
|
||||
- [#8016](https://github.com/apache/incubator-superset/pull/8016) Improve release instructions (#8016) (@mistercrunch)
|
||||
- [#8011](https://github.com/apache/incubator-superset/pull/8011) [SQL Lab] Improve perf for filterable table rendering (#8011) (@etr2460)
|
||||
- [#7822](https://github.com/apache/incubator-superset/pull/7822) Fix tooltips not visible for NVD3 charts on Firefox (#7822) (#7929) (@schoel-bis)
|
||||
- [#8003](https://github.com/apache/incubator-superset/pull/8003) Added better display of NULL values in FilterableTable (as in SQL Lab Results) (#8003) (@semantiDan)
|
||||
|
||||
### 0.34.1 (2019/09/27 18:22 +00:00)
|
||||
- [#8271](https://github.com/apache/incubator-superset/pull/8271) Fix: Missing time series datapoints in druid show up as absurd values in line chart (#8271) (@KKcorps)
|
||||
- [#8265](https://github.com/apache/incubator-superset/pull/8265) Fixed korean translation error. (#8265) (@kuckjwi0928)
|
||||
|
||||
2
setup.py
2
setup.py
@@ -115,7 +115,7 @@ setup(
|
||||
"mysql": ["mysqlclient==1.4.2.post1"],
|
||||
"postgres": ["psycopg2-binary==2.7.5"],
|
||||
"presto": ["pyhive[presto]>=0.4.0"],
|
||||
"druid": ["pydruid==0.5.2", "requests==2.22.0"],
|
||||
"druid": ["pydruid==0.5.7", "requests==2.22.0"],
|
||||
},
|
||||
python_requires="~=3.6",
|
||||
author="Apache Software Foundation",
|
||||
|
||||
299
superset/assets/package-lock.json
generated
299
superset/assets/package-lock.json
generated
@@ -3875,13 +3875,13 @@
|
||||
}
|
||||
},
|
||||
"@superset-ui/legacy-plugin-chart-table": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-table/-/legacy-plugin-chart-table-0.11.0.tgz",
|
||||
"integrity": "sha512-R9LuoWzR9YL/fkBq9iyFnzv3zwcNpU4D22zbtV1sx4EE/Rj2rN6u9glVruKcI4iwUwhakqFiTNMGlBph3A26xw==",
|
||||
"version": "0.11.4",
|
||||
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-table/-/legacy-plugin-chart-table-0.11.4.tgz",
|
||||
"integrity": "sha512-yhzlBSVXNkiC4kkItDUPAYt1ZNDG1de3NhAr8m/ueN39RAsku0+O/3ZW3o2mQC0vjnjhREejUOqC5iaLAi3WQA==",
|
||||
"requires": {
|
||||
"d3": "^3.5.17",
|
||||
"datatables.net-bs": "^1.10.15",
|
||||
"dompurify": "^1.0.3",
|
||||
"dompurify": "^2.0.6",
|
||||
"prop-types": "^15.6.2"
|
||||
}
|
||||
},
|
||||
@@ -3950,14 +3950,14 @@
|
||||
}
|
||||
},
|
||||
"@superset-ui/legacy-preset-chart-nvd3": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.11.0.tgz",
|
||||
"integrity": "sha512-qZKQY/5myO0WKNm3e/8aa0Cp30e6t8fMTNBM+StD8CXfMhH9YEXLLGDyxLMVqY2Ytb2DszsmMLeldMAsdpneNA==",
|
||||
"version": "0.11.5",
|
||||
"resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.11.5.tgz",
|
||||
"integrity": "sha512-OgcivObF02xOOgThOB4iMykjp1Q2WudFAf2H94+TPGlX4vx3opcXInvtxju44bx70ywhtlgp3oYxt1nusE/taQ==",
|
||||
"requires": {
|
||||
"@data-ui/xy-chart": "^0.0.80",
|
||||
"@data-ui/xy-chart": "^0.0.82",
|
||||
"d3": "^3.5.17",
|
||||
"d3-tip": "^0.9.1",
|
||||
"dompurify": "^1.0.3",
|
||||
"dompurify": "^2.0.6",
|
||||
"fast-safe-stringify": "^2.0.6",
|
||||
"lodash": "^4.17.11",
|
||||
"mathjs": "^3.20.2",
|
||||
@@ -3965,6 +3965,275 @@
|
||||
"nvd3": "1.8.6",
|
||||
"prop-types": "^15.6.2",
|
||||
"urijs": "^1.18.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@data-ui/shared": {
|
||||
"version": "0.0.82",
|
||||
"resolved": "https://registry.npmjs.org/@data-ui/shared/-/shared-0.0.82.tgz",
|
||||
"integrity": "sha512-Orh1Be8Mwgjr5Q42AH9BOLZ6wV3C/gEbzsRYqkGOaCtWTYJOTmAxlmnlvZe5CAyo7QDXQHiV2Xvk90FQcQ/NYQ==",
|
||||
"requires": {
|
||||
"@data-ui/theme": "^0.0.82",
|
||||
"@vx/event": "^0.0.165",
|
||||
"@vx/group": "^0.0.165",
|
||||
"@vx/shape": "^0.0.168",
|
||||
"@vx/tooltip": "0.0.165",
|
||||
"d3-array": "^1.2.1",
|
||||
"prop-types": "^15.5.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vx/shape": {
|
||||
"version": "0.0.168",
|
||||
"resolved": "https://registry.npmjs.org/@vx/shape/-/shape-0.0.168.tgz",
|
||||
"integrity": "sha512-urKZkwSafMpPQ0wI/L5FJmufRiAR4UsgYUCKxROjfE1Cf4jWNlK6mlVIIASxCdHlh9CGBbIrRMdl5Yv5lzqhjA==",
|
||||
"requires": {
|
||||
"@vx/curve": "0.0.165",
|
||||
"@vx/group": "0.0.165",
|
||||
"@vx/point": "0.0.165",
|
||||
"classnames": "^2.2.5",
|
||||
"d3-path": "^1.0.5",
|
||||
"d3-shape": "^1.2.0",
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@data-ui/theme": {
|
||||
"version": "0.0.82",
|
||||
"resolved": "https://registry.npmjs.org/@data-ui/theme/-/theme-0.0.82.tgz",
|
||||
"integrity": "sha512-h7lE+jRmkIfKhePvfbpHy+2TcfxTVcffxqV4LubcdzAT7pue/mR90T9NBXwidMSGs2eo2fBl2QJGNICDFT7miA=="
|
||||
},
|
||||
"@data-ui/xy-chart": {
|
||||
"version": "0.0.82",
|
||||
"resolved": "https://registry.npmjs.org/@data-ui/xy-chart/-/xy-chart-0.0.82.tgz",
|
||||
"integrity": "sha512-pzxXv38UfOIMznqO5+iaxLV8+Wra8Rw5MpKnJdOtVdkB2LSgvfRyRyvDF72FsIYIMUmrOIy7XaiEVOsoTZRa9Q==",
|
||||
"requires": {
|
||||
"@data-ui/shared": "^0.0.82",
|
||||
"@data-ui/theme": "^0.0.82",
|
||||
"@vx/axis": "^0.0.175",
|
||||
"@vx/curve": "^0.0.165",
|
||||
"@vx/event": "^0.0.165",
|
||||
"@vx/glyph": "^0.0.165",
|
||||
"@vx/gradient": "^0.0.165",
|
||||
"@vx/grid": "^0.0.180",
|
||||
"@vx/group": "^0.0.165",
|
||||
"@vx/pattern": "^0.0.165",
|
||||
"@vx/point": "^0.0.165",
|
||||
"@vx/responsive": "^0.0.165",
|
||||
"@vx/scale": "^0.0.165",
|
||||
"@vx/shape": "^0.0.165",
|
||||
"@vx/stats": "^0.0.165",
|
||||
"@vx/text": "0.0.183",
|
||||
"@vx/threshold": "0.0.170",
|
||||
"@vx/tooltip": "^0.0.165",
|
||||
"@vx/voronoi": "^0.0.165",
|
||||
"d3-array": "^1.2.0",
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
},
|
||||
"@vx/axis": {
|
||||
"version": "0.0.175",
|
||||
"resolved": "https://registry.npmjs.org/@vx/axis/-/axis-0.0.175.tgz",
|
||||
"integrity": "sha512-qVRIHurnbPnRF4p0KQITArOUSF564tWW1pc48giLz+DJGlcJ4H9RfOSTpV6rnnP15xto6pQdQehBgBAvFRmoig==",
|
||||
"requires": {
|
||||
"@vx/group": "0.0.170",
|
||||
"@vx/point": "0.0.165",
|
||||
"@vx/shape": "0.0.175",
|
||||
"@vx/text": "0.0.175",
|
||||
"classnames": "^2.2.5",
|
||||
"prop-types": "^15.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vx/group": {
|
||||
"version": "0.0.170",
|
||||
"resolved": "https://registry.npmjs.org/@vx/group/-/group-0.0.170.tgz",
|
||||
"integrity": "sha512-RnDdRoy0YI5hokk+YWXc8t39Kp51i4BdCpiwkDJU4YypGycTYnDFjicam6jigUmZ/6wyMirDf/aQboWviFLt2Q==",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5"
|
||||
}
|
||||
},
|
||||
"@vx/shape": {
|
||||
"version": "0.0.175",
|
||||
"resolved": "https://registry.npmjs.org/@vx/shape/-/shape-0.0.175.tgz",
|
||||
"integrity": "sha512-bjAJoIIpKjUEPDV2xmTYGUvSvwRztv+6rd1c6NPZG/nIuqsMHFnFig/2xTcQJEQhRg6aKzvxIUo43zPSSq3fWA==",
|
||||
"requires": {
|
||||
"@vx/curve": "0.0.165",
|
||||
"@vx/group": "0.0.170",
|
||||
"@vx/point": "0.0.165",
|
||||
"classnames": "^2.2.5",
|
||||
"d3-path": "^1.0.5",
|
||||
"d3-shape": "^1.2.0",
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
},
|
||||
"@vx/text": {
|
||||
"version": "0.0.175",
|
||||
"resolved": "https://registry.npmjs.org/@vx/text/-/text-0.0.175.tgz",
|
||||
"integrity": "sha512-SOBhctXXAGhhpCOiTjxOM/8NDaDqGRk3OGfsJ714Mt1UJX6VQaKxFocZJwn6IMw3mNG6/p7O4Eao/gGDcoM6+A==",
|
||||
"requires": {
|
||||
"babel-plugin-lodash": "^3.3.2",
|
||||
"classnames": "^2.2.5",
|
||||
"lodash": "^4.17.4",
|
||||
"reduce-css-calc": "^1.3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@vx/bounds": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/bounds/-/bounds-0.0.165.tgz",
|
||||
"integrity": "sha512-ZvRb72/4QNs1ZrytZTZxd0hfAb/KKfhsdkcYtIQkmdF6dTsjigMQZ+h2bLvLnbZb/RxyCCoxdiZSGXd+T1c//Q==",
|
||||
"requires": {
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
},
|
||||
"@vx/curve": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/curve/-/curve-0.0.165.tgz",
|
||||
"integrity": "sha512-fiQAGrKNGjJbL+eixUckJqIZDWXH/1NtIyyDbSz3J7ksk0QpYr5BgWcNJN76HLNt7wfcLwNzCHeNs4iVYyFGTg==",
|
||||
"requires": {
|
||||
"d3-shape": "^1.0.6"
|
||||
}
|
||||
},
|
||||
"@vx/event": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/event/-/event-0.0.165.tgz",
|
||||
"integrity": "sha512-FsQiw0f3s5DQB6aBQmBcoWk9e4q65LcDobHIyV8qrmpW2QgV2NvQFM1w0Q300ohpRMgJDzGk68HHHQgFOJvApw==",
|
||||
"requires": {
|
||||
"@vx/point": "0.0.165"
|
||||
}
|
||||
},
|
||||
"@vx/glyph": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/glyph/-/glyph-0.0.165.tgz",
|
||||
"integrity": "sha512-kccUm40e/VCtayxqvcwc2K2M6oNXO7IafwIfw1RRv6Fj4Iutto9ZpI+PGOf/zPnYVueoLnWBXT/HE7IRS+C2gw==",
|
||||
"requires": {
|
||||
"@vx/group": "0.0.165",
|
||||
"classnames": "^2.2.5",
|
||||
"d3-shape": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"@vx/gradient": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/gradient/-/gradient-0.0.165.tgz",
|
||||
"integrity": "sha512-FjRXMTmcy7k0TWsfDzWWXw6T9WXKP+6LS/GRgnguq271pab/P+AdOJThsVxtBgUc8ZOAPbub3/2Gggz9d8tocg==",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5",
|
||||
"prop-types": "^15.5.7"
|
||||
}
|
||||
},
|
||||
"@vx/grid": {
|
||||
"version": "0.0.180",
|
||||
"resolved": "https://registry.npmjs.org/@vx/grid/-/grid-0.0.180.tgz",
|
||||
"integrity": "sha512-+ugS0c6GbwHr6pFU0znnOG3/zTwRRadvWwj3E4ZOHmKUSz6ZEN6JNo+rD3WSZckYwLis6UivmYfJ5cV6AM4ufg==",
|
||||
"requires": {
|
||||
"@vx/group": "0.0.170",
|
||||
"@vx/point": "0.0.165",
|
||||
"@vx/shape": "0.0.179",
|
||||
"classnames": "^2.2.5",
|
||||
"prop-types": "^15.6.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vx/group": {
|
||||
"version": "0.0.170",
|
||||
"resolved": "https://registry.npmjs.org/@vx/group/-/group-0.0.170.tgz",
|
||||
"integrity": "sha512-RnDdRoy0YI5hokk+YWXc8t39Kp51i4BdCpiwkDJU4YypGycTYnDFjicam6jigUmZ/6wyMirDf/aQboWviFLt2Q==",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5"
|
||||
}
|
||||
},
|
||||
"@vx/shape": {
|
||||
"version": "0.0.179",
|
||||
"resolved": "https://registry.npmjs.org/@vx/shape/-/shape-0.0.179.tgz",
|
||||
"integrity": "sha512-YHVNx4xGpbjolkW3Lb5pEgJB0+u349vfnLI976DJlinY0hRNa4TZbWXOB4ywLIrYzQEXXPMUR8WtdubNxg6g0w==",
|
||||
"requires": {
|
||||
"@vx/curve": "0.0.165",
|
||||
"@vx/group": "0.0.170",
|
||||
"@vx/point": "0.0.165",
|
||||
"classnames": "^2.2.5",
|
||||
"d3-path": "^1.0.5",
|
||||
"d3-shape": "^1.2.0",
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@vx/group": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/group/-/group-0.0.165.tgz",
|
||||
"integrity": "sha512-gi1DSg8AAaVRseyWiq8y4bzyvKiQIXT6vDUYBVRmv2LBcpHocBGaxNiNK0X602RgLG0XmNyRv6qSCWLOaBs3Mg==",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5"
|
||||
}
|
||||
},
|
||||
"@vx/pattern": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/pattern/-/pattern-0.0.165.tgz",
|
||||
"integrity": "sha512-h5nmfcYlQYYzNhlhqaYUvVnkmGnC0yWv5yU1snjHweGmIHTovV3RAbKgVFAP7kB3i2rbEtC3O8WkJN++cZdLzA==",
|
||||
"requires": {
|
||||
"classnames": "^2.2.5",
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
},
|
||||
"@vx/point": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/point/-/point-0.0.165.tgz",
|
||||
"integrity": "sha512-spoHilhjcWNgccrSzBUPw+PXV81tYxeyEWBkgr35aGVU4m7YT86Ywvfemwp7AVVGPn+XJHrhB0ujAhDoyqFPoA=="
|
||||
},
|
||||
"@vx/responsive": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/responsive/-/responsive-0.0.165.tgz",
|
||||
"integrity": "sha512-b5PYEzsjgTGuH4qN2ujghq2uKQsPGBEtOAO1791WdA0j6rr0zbVsHVmJeEhvoOg0b3xhdNN1mXAzQr4K9lDaDw==",
|
||||
"requires": {
|
||||
"lodash": "^4.17.10",
|
||||
"prop-types": "^15.6.1",
|
||||
"resize-observer-polyfill": "1.5.0"
|
||||
}
|
||||
},
|
||||
"@vx/scale": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/scale/-/scale-0.0.165.tgz",
|
||||
"integrity": "sha512-5jSgXJDU6J/KWIyCbpjHqysPCddp7tG3LbTV7UmtB1Qleb4m4slShTVSE7+EKU+zgiQPDGm0+E2ht4cet+7F7A==",
|
||||
"requires": {
|
||||
"d3-scale": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@vx/shape": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/shape/-/shape-0.0.165.tgz",
|
||||
"integrity": "sha512-D9naH/glDtw8J8IcdumpRz1ihaoCAYMwFNh2KTv73HiTKrLQSXvIjwYFv9C0b8BCPNOXkDZS8s+AlgMSqGlZNQ==",
|
||||
"requires": {
|
||||
"@vx/curve": "0.0.165",
|
||||
"@vx/group": "0.0.165",
|
||||
"@vx/point": "0.0.165",
|
||||
"classnames": "^2.2.5",
|
||||
"d3-path": "^1.0.5",
|
||||
"d3-shape": "^1.2.0",
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
},
|
||||
"@vx/text": {
|
||||
"version": "0.0.183",
|
||||
"resolved": "https://registry.npmjs.org/@vx/text/-/text-0.0.183.tgz",
|
||||
"integrity": "sha512-SM97C6I2Oy3FdbjM0zb2oZ8xgPskQE3r0FdGHZgq6Dk1b3lYwuW3KqdXn598BRl3iL9jfSyR6vFN9z6NV0FFww==",
|
||||
"requires": {
|
||||
"@babel/core": "^7.0.0",
|
||||
"babel-plugin-lodash": "^3.3.2",
|
||||
"classnames": "^2.2.5",
|
||||
"lodash": "^4.17.4",
|
||||
"prop-types": "^15.6.2",
|
||||
"reduce-css-calc": "^1.3.0"
|
||||
}
|
||||
},
|
||||
"@vx/tooltip": {
|
||||
"version": "0.0.165",
|
||||
"resolved": "https://registry.npmjs.org/@vx/tooltip/-/tooltip-0.0.165.tgz",
|
||||
"integrity": "sha512-/x1NZc67QGQ4e/WNT7Ks5LYRyeLSqp8lG04gX5J6leUS0zscAVzo3aE5u65Qqbc0cnMyMPRZ2Qtb4klWTLg+eQ==",
|
||||
"requires": {
|
||||
"@vx/bounds": "0.0.165",
|
||||
"classnames": "^2.2.5",
|
||||
"prop-types": "^15.5.10"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@superset-ui/number-format": {
|
||||
@@ -9219,9 +9488,9 @@
|
||||
}
|
||||
},
|
||||
"dompurify": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-1.0.8.tgz",
|
||||
"integrity": "sha512-vetRFbN1SXSPfP3ClIiYnxTrXquSqakBEOoB5JESn0SVcSYzpu6ougjakpKnskGctYdlNpwf+riUHSkG7d4XUw=="
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.0.7.tgz",
|
||||
"integrity": "sha512-S3O0lk6rFJtO01ZTzMollCOGg+WAtCwS3U5E2WSDY/x/sy7q70RjEC4Dmrih5/UqzLLB9XoKJ8KqwBxaNvBu4A=="
|
||||
},
|
||||
"domutils": {
|
||||
"version": "1.5.1",
|
||||
@@ -10399,9 +10668,9 @@
|
||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
|
||||
},
|
||||
"fast-safe-stringify": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.6.tgz",
|
||||
"integrity": "sha512-q8BZ89jjc+mz08rSxROs8VsrBBcn1SIw1kq9NjolL509tkABRk9io01RAjSaEv1Xb2uFLt8VtRiZbGp5H8iDtg=="
|
||||
"version": "2.0.7",
|
||||
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz",
|
||||
"integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA=="
|
||||
},
|
||||
"fastparse": {
|
||||
"version": "1.1.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "superset",
|
||||
"version": "0.999.0dev",
|
||||
"version": "0.35.1",
|
||||
"description": "Superset is a data exploration platform designed to be visual, intuitive, and interactive.",
|
||||
"license": "Apache-2.0",
|
||||
"directories": {
|
||||
@@ -71,13 +71,13 @@
|
||||
"@superset-ui/legacy-plugin-chart-rose": "^0.11.0",
|
||||
"@superset-ui/legacy-plugin-chart-sankey": "^0.11.0",
|
||||
"@superset-ui/legacy-plugin-chart-sunburst": "^0.11.0",
|
||||
"@superset-ui/legacy-plugin-chart-table": "^0.11.0",
|
||||
"@superset-ui/legacy-plugin-chart-table": "^0.11.4",
|
||||
"@superset-ui/legacy-plugin-chart-treemap": "^0.11.0",
|
||||
"@superset-ui/legacy-plugin-chart-word-cloud": "^0.11.0",
|
||||
"@superset-ui/legacy-plugin-chart-world-map": "^0.11.0",
|
||||
"@superset-ui/legacy-preset-chart-big-number": "^0.11.0",
|
||||
"@superset-ui/legacy-preset-chart-deckgl": "^0.1.0",
|
||||
"@superset-ui/legacy-preset-chart-nvd3": "^0.11.0",
|
||||
"@superset-ui/legacy-preset-chart-nvd3": "^0.11.5",
|
||||
"@superset-ui/number-format": "^0.12.1",
|
||||
"@superset-ui/plugin-chart-table": "^0.11.0",
|
||||
"@superset-ui/preset-chart-xy": "^0.11.0",
|
||||
@@ -98,7 +98,7 @@
|
||||
"d3-color": "^1.2.0",
|
||||
"d3-scale": "^2.1.2",
|
||||
"dnd-core": "^2.6.0",
|
||||
"dompurify": "^1.0.3",
|
||||
"dompurify": "^2.0.7",
|
||||
"geolib": "^2.0.24",
|
||||
"immutable": "^3.8.2",
|
||||
"jquery": "^3.4.1",
|
||||
|
||||
@@ -78,9 +78,7 @@ class QueryObject:
|
||||
)
|
||||
self.is_timeseries = is_timeseries
|
||||
self.time_range = time_range
|
||||
self.time_shift = (
|
||||
utils.parse_human_timedelta(time_shift) if time_shift else None
|
||||
)
|
||||
self.time_shift = utils.parse_human_timedelta(time_shift)
|
||||
self.groupby = groupby or []
|
||||
|
||||
# Temporal solution for backward compatability issue
|
||||
|
||||
@@ -279,7 +279,7 @@ SUPERSET_WEBSERVER_DOMAINS = None
|
||||
|
||||
# Allowed format types for upload on Database view
|
||||
# TODO: Add processing of other spreadsheet formats (xls, xlsx etc)
|
||||
ALLOWED_EXTENSIONS = set(["csv"])
|
||||
ALLOWED_EXTENSIONS = {"csv", "tsv"}
|
||||
|
||||
# CSV Options: key/value pairs that will be passed as argument to DataFrame.to_csv
|
||||
# method.
|
||||
|
||||
@@ -167,7 +167,7 @@ class DruidCluster(Model, AuditMixinNullable, ImportMixin):
|
||||
base_url = self.get_base_url(self.broker_host, self.broker_port)
|
||||
return f"{base_url}/{self.broker_endpoint}"
|
||||
|
||||
def get_pydruid_client(self) -> PyDruid:
|
||||
def get_pydruid_client(self) -> "PyDruid":
|
||||
cli = PyDruid(
|
||||
self.get_base_url(self.broker_host, self.broker_port), self.broker_endpoint
|
||||
)
|
||||
@@ -829,7 +829,7 @@ class DruidDatasource(Model, BaseDatasource):
|
||||
return granularity
|
||||
|
||||
@staticmethod
|
||||
def get_post_agg(mconf: Dict) -> Postaggregator:
|
||||
def get_post_agg(mconf: Dict) -> "Postaggregator":
|
||||
"""
|
||||
For a metric specified as `postagg` returns the
|
||||
kind of post aggregation for pydruid.
|
||||
@@ -1441,7 +1441,7 @@ class DruidDatasource(Model, BaseDatasource):
|
||||
return (col, extraction_fn)
|
||||
|
||||
@classmethod
|
||||
def get_filters(cls, raw_filters, num_cols, columns_dict) -> Filter:
|
||||
def get_filters(cls, raw_filters, num_cols, columns_dict) -> "Filter":
|
||||
"""Given Superset filter data structure, returns pydruid Filter(s)"""
|
||||
filters = None
|
||||
for flt in raw_filters:
|
||||
@@ -1570,7 +1570,7 @@ class DruidDatasource(Model, BaseDatasource):
|
||||
|
||||
return filters
|
||||
|
||||
def _get_having_obj(self, col: str, op: str, eq: str) -> Having:
|
||||
def _get_having_obj(self, col: str, op: str, eq: str) -> "Having":
|
||||
cond = None
|
||||
if op == "==":
|
||||
if col in self.column_names:
|
||||
@@ -1584,7 +1584,7 @@ class DruidDatasource(Model, BaseDatasource):
|
||||
|
||||
return cond
|
||||
|
||||
def get_having_filters(self, raw_filters: List[Dict]) -> Having:
|
||||
def get_having_filters(self, raw_filters: List[Dict]) -> "Having":
|
||||
filters = None
|
||||
reversed_op_map = {"!=": "==", ">=": "<", "<=": ">"}
|
||||
|
||||
|
||||
@@ -239,6 +239,8 @@ class DruidClusterModelView(SupersetModelView, DeleteMixin, YamlExportMixin):
|
||||
),
|
||||
}
|
||||
|
||||
yaml_dict_key = "databases"
|
||||
|
||||
edit_form_extra_fields = {
|
||||
"cluster_name": QuerySelectField(
|
||||
"Cluster",
|
||||
|
||||
@@ -37,7 +37,7 @@ from sqlalchemy.sql.expression import ColumnClause, ColumnElement, Select, TextA
|
||||
from sqlalchemy.types import TypeEngine
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
from superset import app, db, sql_parse
|
||||
from superset import app, sql_parse
|
||||
from superset.utils import core as utils
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -388,15 +388,17 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
|
||||
df.to_sql(**kwargs)
|
||||
|
||||
@classmethod
|
||||
def create_table_from_csv(cls, form, table):
|
||||
""" Create table (including metadata in backend) from contents of a csv.
|
||||
def create_table_from_csv(cls, form) -> None:
|
||||
"""
|
||||
Create table from contents of a csv. Note: this method does not create
|
||||
metadata for the table.
|
||||
|
||||
:param form: Parameters defining how to process data
|
||||
:param table: Metadata of new table to be created
|
||||
"""
|
||||
|
||||
def _allowed_file(filename: str) -> bool:
|
||||
# Only allow specific file extensions as specified in the config
|
||||
extension = os.path.splitext(filename)[1]
|
||||
extension = os.path.splitext(filename)[1].lower()
|
||||
return (
|
||||
extension is not None and extension[1:] in config["ALLOWED_EXTENSIONS"]
|
||||
)
|
||||
@@ -432,12 +434,6 @@ class BaseEngineSpec: # pylint: disable=too-many-public-methods
|
||||
}
|
||||
cls.df_to_sql(**df_to_sql_kwargs)
|
||||
|
||||
table.user_id = g.user.id
|
||||
table.schema = form.schema.data
|
||||
table.fetch_metadata()
|
||||
db.session.add(table)
|
||||
db.session.commit()
|
||||
|
||||
@classmethod
|
||||
def convert_dttm(cls, target_type: str, dttm: datetime) -> str:
|
||||
"""
|
||||
|
||||
@@ -98,7 +98,7 @@ class HiveEngineSpec(PrestoEngineSpec):
|
||||
return []
|
||||
|
||||
@classmethod
|
||||
def create_table_from_csv(cls, form, table): # pylint: disable=too-many-locals
|
||||
def create_table_from_csv(cls, form) -> None: # pylint: disable=too-many-locals
|
||||
"""Uploads a csv file and creates a superset datasource in Hive."""
|
||||
|
||||
def convert_to_hive_type(col_type):
|
||||
|
||||
@@ -327,7 +327,7 @@ def load_world_bank_health_n_pop(only_metadata=False, force=False):
|
||||
merge_slice(slc)
|
||||
|
||||
print("Creating a World's Health Bank dashboard")
|
||||
dash_name = "World's Bank Data"
|
||||
dash_name = "World Bank's Data"
|
||||
slug = "world_health"
|
||||
dash = db.session.query(Dash).filter_by(slug=slug).first()
|
||||
|
||||
|
||||
@@ -4669,7 +4669,7 @@ msgid "CSV to Database configuration"
|
||||
msgstr ""
|
||||
|
||||
#: superset/views/core.py:375
|
||||
msgid "CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\""
|
||||
msgid "CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\""
|
||||
msgstr ""
|
||||
|
||||
#: superset/views/core.py:401 superset/views/core.py:667
|
||||
@@ -7765,4 +7765,3 @@ msgstr ""
|
||||
|
||||
#~ msgid "Saved Queries"
|
||||
#~ msgstr ""
|
||||
|
||||
|
||||
@@ -3124,7 +3124,7 @@
|
||||
"CSV to Database configuration": [
|
||||
""
|
||||
],
|
||||
"CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\"": [
|
||||
"CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\"": [
|
||||
""
|
||||
],
|
||||
"User": [
|
||||
|
||||
@@ -4880,8 +4880,8 @@ msgid "CSV to Database configuration"
|
||||
msgstr "CSV vers la configuration de la base de données"
|
||||
|
||||
#: superset/views/core.py:375
|
||||
msgid "CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\""
|
||||
msgstr "Fichier CSV \"{0}\" chargé dans la table \"{1}\" de la base de données \"{2}\""
|
||||
msgid "CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\""
|
||||
msgstr "Fichier CSV \"%(csv_filename)s\" chargé dans la table \"%(table_name)s\" de la base de données \"%(db_name)s\""
|
||||
|
||||
#: superset/views/core.py:401 superset/views/core.py:667
|
||||
#: superset/views/sql_lab.py:23 superset/views/sql_lab.py:60
|
||||
|
||||
@@ -2923,7 +2923,7 @@
|
||||
"CSV to Database configuration": [
|
||||
""
|
||||
],
|
||||
"CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\"": [
|
||||
"CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\"": [
|
||||
""
|
||||
],
|
||||
"User": [
|
||||
@@ -3132,4 +3132,4 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4432,7 +4432,7 @@ msgid "CSV to Database configuration"
|
||||
msgstr ""
|
||||
|
||||
#: superset/views/core.py:363
|
||||
msgid "CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\""
|
||||
msgid "CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\""
|
||||
msgstr ""
|
||||
|
||||
#: superset/views/core.py:389 superset/views/core.py:655
|
||||
@@ -6461,4 +6461,3 @@ msgstr "Query salvate"
|
||||
|
||||
#~ msgid "Slice"
|
||||
#~ msgstr "Slice"
|
||||
|
||||
|
||||
@@ -3788,7 +3788,7 @@ msgstr "대시보드 가져오기"
|
||||
msgid "CSV to Database configuration"
|
||||
msgstr ""
|
||||
|
||||
msgid "CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\""
|
||||
msgid "CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\""
|
||||
msgstr ""
|
||||
|
||||
msgid "User"
|
||||
|
||||
@@ -4669,7 +4669,7 @@ msgid "CSV to Database configuration"
|
||||
msgstr ""
|
||||
|
||||
#: superset/views/core.py:375
|
||||
msgid "CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\""
|
||||
msgid "CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\""
|
||||
msgstr ""
|
||||
|
||||
#: superset/views/core.py:401 superset/views/core.py:667
|
||||
@@ -4967,4 +4967,3 @@ msgstr ""
|
||||
#: superset/views/sql_lab.py:86
|
||||
msgid "Saved Queries"
|
||||
msgstr ""
|
||||
|
||||
|
||||
@@ -2923,8 +2923,8 @@
|
||||
"CSV to Database configuration": [
|
||||
"Настройка CSV для БД"
|
||||
],
|
||||
"CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\"": [
|
||||
"CSV-файл \"{0}\" загружен в таблицу \"{1}\" базы данных \"{2}\""
|
||||
"CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\"": [
|
||||
"CSV-файл \"%(csv_filename)s\" загружен в таблицу \"%(table_name)s\" базы данных \"%(db_name)s\""
|
||||
],
|
||||
"User": [
|
||||
"Пользователь"
|
||||
@@ -3132,4 +3132,4 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4544,8 +4544,8 @@ msgid "CSV to Database configuration"
|
||||
msgstr "Настройка CSV для БД"
|
||||
|
||||
#: superset/views/core.py:363
|
||||
msgid "CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\""
|
||||
msgstr "CSV-файл \"{0}\" загружен в таблицу \"{1}\" базы данных \"{2}\""
|
||||
msgid "CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\""
|
||||
msgstr "CSV-файл \"%(csv_filename)s\" загружен в таблицу \"%(table_name)s\" базы данных \"%(db_name)s\""
|
||||
|
||||
#: superset/views/core.py:389 superset/views/core.py:655
|
||||
#: superset/views/sql_lab.py:16 superset/views/sql_lab.py:53
|
||||
|
||||
@@ -3124,8 +3124,8 @@
|
||||
"CSV to Database configuration": [
|
||||
"csv 到数据库配置"
|
||||
],
|
||||
"CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\"": [
|
||||
"csv 文件 \"{0}\" 上传到数据库 \"{2}\" 中的表 \"{1}\""
|
||||
"CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\"": [
|
||||
"csv 文件 \"%(csv_filename)s\" 上传到数据库 \"%(db_name)s\" 中的表 \"%(table_name)s\""
|
||||
],
|
||||
"User": [
|
||||
"用户"
|
||||
|
||||
@@ -4746,8 +4746,8 @@ msgid "CSV to Database configuration"
|
||||
msgstr "csv 到数据库配置"
|
||||
|
||||
#: superset/views/core.py:375
|
||||
msgid "CSV file \"{0}\" uploaded to table \"{1}\" in database \"{2}\""
|
||||
msgstr "csv 文件 \"{0}\" 上传到数据库 \"{2}\" 中的表 \"{1}\""
|
||||
msgid "CSV file \"%(csv_filename)s\" uploaded to table \"%(table_name)s\" in database \"%(db_name)s\""
|
||||
msgstr "csv 文件 \"%(csv_filename)s\" 上传到数据库 \"%(db_name)s\" 中的表 \"%(table_name)s\""
|
||||
|
||||
#: superset/views/core.py:401 superset/views/core.py:667
|
||||
#: superset/views/sql_lab.py:23 superset/views/sql_lab.py:60
|
||||
|
||||
@@ -291,7 +291,7 @@ class DashboardEncoder(json.JSONEncoder):
|
||||
return json.JSONEncoder(sort_keys=True).default(self, o)
|
||||
|
||||
|
||||
def parse_human_timedelta(s: str) -> timedelta:
|
||||
def parse_human_timedelta(s: Optional[str]) -> timedelta:
|
||||
"""
|
||||
Returns ``datetime.datetime`` from natural language time deltas
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ def import_datasource(
|
||||
"""Imports the datasource from the object to the database.
|
||||
|
||||
Metrics and columns and datasource will be overrided if exists.
|
||||
This function can be used to import/export dashboards between multiple
|
||||
This function can be used to import/export datasources between multiple
|
||||
superset instances. Audit metadata isn't copies over.
|
||||
"""
|
||||
make_transient(i_datasource)
|
||||
|
||||
@@ -19,7 +19,7 @@ import functools
|
||||
import logging
|
||||
import traceback
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
import simplejson as json
|
||||
import yaml
|
||||
@@ -207,12 +207,20 @@ def validate_json(form, field):
|
||||
|
||||
|
||||
class YamlExportMixin(object):
|
||||
yaml_dict_key: Optional[str] = None
|
||||
"""
|
||||
Override this if you want a dict response instead, with a certain key.
|
||||
Used on DatabaseView for cli compatibility
|
||||
"""
|
||||
|
||||
@action("yaml_export", __("Export to YAML"), __("Export to YAML?"), "fa-download")
|
||||
def yaml_export(self, items):
|
||||
if not isinstance(items, list):
|
||||
items = [items]
|
||||
|
||||
data = [t.export_to_dict() for t in items]
|
||||
if self.yaml_dict_key:
|
||||
data = {self.yaml_dict_key: data}
|
||||
return Response(
|
||||
yaml.safe_dump(data),
|
||||
headers=generate_download_headers("yaml"),
|
||||
|
||||
@@ -2999,7 +2999,7 @@ class Superset(BaseSupersetView):
|
||||
except Exception:
|
||||
return json_error_response(
|
||||
"Failed to fetch schemas allowed for csv upload in this database! "
|
||||
"Please contact Superset Admin!",
|
||||
"Please contact your Superset Admin!",
|
||||
stacktrace=utils.get_stacktrace(),
|
||||
)
|
||||
|
||||
|
||||
@@ -90,7 +90,17 @@ class CsvToDatabaseForm(DynamicForm):
|
||||
csv_file = FileField(
|
||||
_("CSV File"),
|
||||
description=_("Select a CSV file to be uploaded to a database."),
|
||||
validators=[FileRequired(), FileAllowed(["csv"], _("CSV Files Only!"))],
|
||||
validators=[
|
||||
FileRequired(),
|
||||
FileAllowed(
|
||||
config["ALLOWED_EXTENSIONS"],
|
||||
_(
|
||||
"Only the following file extensions are allowed: "
|
||||
"%(allowed_extensions)s",
|
||||
allowed_extensions=", ".join(config["ALLOWED_EXTENSIONS"]),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
con = QuerySelectField(
|
||||
_("Database"),
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# pylint: disable=C,R,W
|
||||
import os
|
||||
|
||||
from flask import flash, redirect
|
||||
from flask import flash, g, redirect
|
||||
from flask_appbuilder import SimpleFormView
|
||||
from flask_appbuilder.forms import DynamicForm
|
||||
from flask_appbuilder.models.sqla.interface import SQLAInterface
|
||||
@@ -28,7 +28,7 @@ from wtforms.fields import StringField
|
||||
from wtforms.validators import ValidationError
|
||||
|
||||
import superset.models.core as models
|
||||
from superset import app, appbuilder, security_manager
|
||||
from superset import app, appbuilder, db, security_manager
|
||||
from superset.connectors.sqla.models import SqlaTable
|
||||
from superset.utils import core as utils
|
||||
from superset.views.base import DeleteMixin, SupersetModelView, YamlExportMixin
|
||||
@@ -54,6 +54,8 @@ class DatabaseView(DatabaseMixin, SupersetModelView, DeleteMixin, YamlExportMixi
|
||||
edit_template = "superset/models/database/edit.html"
|
||||
validators_columns = {"sqlalchemy_uri": [sqlalchemy_uri_form_validator]}
|
||||
|
||||
yaml_dict_key = "databases"
|
||||
|
||||
def _delete(self, pk):
|
||||
DeleteMixin._delete(self, pk)
|
||||
|
||||
@@ -102,10 +104,10 @@ class CsvToDatabaseView(SimpleFormView):
|
||||
|
||||
if not self.is_schema_allowed(database, schema_name):
|
||||
message = _(
|
||||
'Database "{0}" Schema "{1}" is not allowed for csv uploads. '
|
||||
"Please contact Superset Admin".format(
|
||||
database.database_name, schema_name
|
||||
)
|
||||
'Database "%(database_name)s" schema "%(schema_name)s" '
|
||||
"is not allowed for csv uploads. Please contact your Superset Admin.",
|
||||
database_name=database.database_name,
|
||||
schema_name=schema_name,
|
||||
)
|
||||
flash(message, "danger")
|
||||
return redirect("/csvtodatabaseview/form")
|
||||
@@ -117,32 +119,58 @@ class CsvToDatabaseView(SimpleFormView):
|
||||
try:
|
||||
utils.ensure_path_exists(config["UPLOAD_FOLDER"])
|
||||
csv_file.save(path)
|
||||
table = SqlaTable(table_name=form.name.data)
|
||||
table.database = form.data.get("con")
|
||||
table.database_id = table.database.id
|
||||
table.database.db_engine_spec.create_table_from_csv(form, table)
|
||||
table_name = form.name.data
|
||||
database = form.data.get("con")
|
||||
database.db_engine_spec.create_table_from_csv(form)
|
||||
|
||||
table = (
|
||||
db.session.query(SqlaTable)
|
||||
.filter_by(
|
||||
table_name=table_name,
|
||||
schema=form.schema.data,
|
||||
database_id=database.id,
|
||||
)
|
||||
.one_or_none()
|
||||
)
|
||||
if table:
|
||||
table.fetch_metadata()
|
||||
if not table:
|
||||
table = SqlaTable(table_name=table_name)
|
||||
table.database = database
|
||||
table.database_id = database.id
|
||||
table.user_id = g.user.id
|
||||
table.schema = form.schema.data
|
||||
table.fetch_metadata()
|
||||
db.session.add(table)
|
||||
db.session.commit()
|
||||
except Exception as e:
|
||||
db.session.rollback()
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
pass
|
||||
message = (
|
||||
"Table name {} already exists. Please pick another".format(
|
||||
form.name.data
|
||||
)
|
||||
if isinstance(e, IntegrityError)
|
||||
else str(e)
|
||||
message = _(
|
||||
'Unable to upload CSV file "%(filename)s" to table '
|
||||
'"%(table_name)s" in database "%(db_name)s". '
|
||||
"Error message: %(error_msg)s",
|
||||
filename=csv_filename,
|
||||
table_name=form.name.data,
|
||||
db_name=database.database_name,
|
||||
error_msg=str(e),
|
||||
)
|
||||
|
||||
flash(message, "danger")
|
||||
stats_logger.incr("failed_csv_upload")
|
||||
return redirect("/csvtodatabaseview/form")
|
||||
|
||||
os.remove(path)
|
||||
# Go back to welcome page / splash screen
|
||||
db_name = table.database.database_name
|
||||
message = _(
|
||||
'CSV file "{0}" uploaded to table "{1}" in '
|
||||
'database "{2}"'.format(csv_filename, form.name.data, db_name)
|
||||
'CSV file "%(csv_filename)s" uploaded to table "%(table_name)s" in '
|
||||
'database "%(db_name)s"',
|
||||
csv_filename=csv_filename,
|
||||
table_name=form.name.data,
|
||||
db_name=table.database.database_name,
|
||||
)
|
||||
flash(message, "info")
|
||||
stats_logger.incr("successful_csv_upload")
|
||||
|
||||
@@ -598,42 +598,100 @@ class CoreTests(SupersetTestCase):
|
||||
|
||||
def test_import_csv(self):
|
||||
self.login(username="admin")
|
||||
filename = "testCSV.csv"
|
||||
table_name = "".join(random.choice(string.ascii_uppercase) for _ in range(5))
|
||||
|
||||
test_file = open(filename, "w+")
|
||||
test_file.write("a,b\n")
|
||||
test_file.write("john,1\n")
|
||||
test_file.write("paul,2\n")
|
||||
test_file.close()
|
||||
filename_1 = "testCSV.csv"
|
||||
test_file_1 = open(filename_1, "w+")
|
||||
test_file_1.write("a,b\n")
|
||||
test_file_1.write("john,1\n")
|
||||
test_file_1.write("paul,2\n")
|
||||
test_file_1.close()
|
||||
|
||||
filename_2 = "testCSV2.csv"
|
||||
test_file_2 = open(filename_2, "w+")
|
||||
test_file_2.write("b,c,d\n")
|
||||
test_file_2.write("john,1,x\n")
|
||||
test_file_2.write("paul,2,y\n")
|
||||
test_file_2.close()
|
||||
|
||||
example_db = utils.get_example_database()
|
||||
example_db.allow_csv_upload = True
|
||||
db_id = example_db.id
|
||||
db.session.commit()
|
||||
test_file = open(filename, "rb")
|
||||
form_data = {
|
||||
"csv_file": test_file,
|
||||
"csv_file": open(filename_1, "rb"),
|
||||
"sep": ",",
|
||||
"name": table_name,
|
||||
"con": db_id,
|
||||
"if_exists": "append",
|
||||
"if_exists": "fail",
|
||||
"index_label": "test_label",
|
||||
"mangle_dupe_cols": False,
|
||||
}
|
||||
url = "/databaseview/list/"
|
||||
add_datasource_page = self.get_resp(url)
|
||||
assert "Upload a CSV" in add_datasource_page
|
||||
self.assertIn("Upload a CSV", add_datasource_page)
|
||||
|
||||
url = "/csvtodatabaseview/form"
|
||||
form_get = self.get_resp(url)
|
||||
assert "CSV to Database configuration" in form_get
|
||||
self.assertIn("CSV to Database configuration", form_get)
|
||||
|
||||
try:
|
||||
# ensure uploaded successfully
|
||||
# initial upload with fail mode
|
||||
resp = self.get_resp(url, data=form_data)
|
||||
assert 'CSV file "testCSV.csv" uploaded to table' in resp
|
||||
self.assertIn(
|
||||
f'CSV file "{filename_1}" uploaded to table "{table_name}"', resp
|
||||
)
|
||||
|
||||
# upload again with fail mode; should fail
|
||||
form_data["csv_file"] = open(filename_1, "rb")
|
||||
resp = self.get_resp(url, data=form_data)
|
||||
self.assertIn(
|
||||
f'Unable to upload CSV file "{filename_1}" to table "{table_name}"',
|
||||
resp,
|
||||
)
|
||||
|
||||
# upload again with append mode
|
||||
form_data["csv_file"] = open(filename_1, "rb")
|
||||
form_data["if_exists"] = "append"
|
||||
resp = self.get_resp(url, data=form_data)
|
||||
self.assertIn(
|
||||
f'CSV file "{filename_1}" uploaded to table "{table_name}"', resp
|
||||
)
|
||||
|
||||
# upload again with replace mode
|
||||
form_data["csv_file"] = open(filename_1, "rb")
|
||||
form_data["if_exists"] = "replace"
|
||||
resp = self.get_resp(url, data=form_data)
|
||||
self.assertIn(
|
||||
f'CSV file "{filename_1}" uploaded to table "{table_name}"', resp
|
||||
)
|
||||
|
||||
# try to append to table from file with different schema
|
||||
form_data["csv_file"] = open(filename_2, "rb")
|
||||
form_data["if_exists"] = "append"
|
||||
resp = self.get_resp(url, data=form_data)
|
||||
self.assertIn(
|
||||
f'Unable to upload CSV file "{filename_2}" to table "{table_name}"',
|
||||
resp,
|
||||
)
|
||||
|
||||
# replace table from file with different schema
|
||||
form_data["csv_file"] = open(filename_2, "rb")
|
||||
form_data["if_exists"] = "replace"
|
||||
resp = self.get_resp(url, data=form_data)
|
||||
self.assertIn(
|
||||
f'CSV file "{filename_2}" uploaded to table "{table_name}"', resp
|
||||
)
|
||||
table = (
|
||||
db.session.query(SqlaTable)
|
||||
.filter_by(table_name=table_name, database_id=db_id)
|
||||
.first()
|
||||
)
|
||||
# make sure the new column name is reflected in the table metadata
|
||||
self.assertIn("d", table.column_names)
|
||||
finally:
|
||||
os.remove(filename)
|
||||
os.remove(filename_1)
|
||||
os.remove(filename_2)
|
||||
|
||||
def test_dataframe_timezone(self):
|
||||
tz = psycopg2.tz.FixedOffsetTimezone(offset=60, name=None)
|
||||
|
||||
@@ -24,6 +24,7 @@ from superset import db
|
||||
from superset.connectors.druid.models import DruidColumn, DruidDatasource, DruidMetric
|
||||
from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
|
||||
from superset.utils.core import get_example_database
|
||||
from superset.utils.dict_import_export import export_to_dict
|
||||
|
||||
from .base_tests import SupersetTestCase
|
||||
|
||||
@@ -266,6 +267,26 @@ class DictImportExportTests(SupersetTestCase):
|
||||
imported_copy_table.export_to_dict(), imported_table.export_to_dict()
|
||||
)
|
||||
|
||||
def test_export_datasource_ui_cli(self):
|
||||
cli_export = export_to_dict(
|
||||
session=db.session,
|
||||
recursive=True,
|
||||
back_references=False,
|
||||
include_defaults=False,
|
||||
)
|
||||
self.get_resp("/login/", data=dict(username="admin", password="general"))
|
||||
resp = self.get_resp(
|
||||
"/databaseview/action_post", {"action": "yaml_export", "rowid": 1}
|
||||
)
|
||||
ui_export = yaml.safe_load(resp)
|
||||
self.assertEqual(
|
||||
ui_export["databases"][0]["database_name"],
|
||||
cli_export["databases"][0]["database_name"],
|
||||
)
|
||||
self.assertEqual(
|
||||
ui_export["databases"][0]["tables"], cli_export["databases"][0]["tables"]
|
||||
)
|
||||
|
||||
def test_import_druid_no_metadata(self):
|
||||
datasource, dict_datasource = self.create_druid_datasource(
|
||||
"pure_druid", id=ID_PREFIX + 1
|
||||
|
||||
@@ -130,6 +130,7 @@ class UtilsTestCase(unittest.TestCase):
|
||||
self.assertEqual(parse_human_timedelta("now"), timedelta(0))
|
||||
self.assertEqual(parse_human_timedelta("1 year"), timedelta(366))
|
||||
self.assertEqual(parse_human_timedelta("-1 year"), timedelta(-365))
|
||||
self.assertEqual(parse_human_timedelta(None), timedelta(0))
|
||||
|
||||
@patch("superset.utils.core.datetime")
|
||||
def test_parse_past_timedelta(self, mock_datetime):
|
||||
|
||||
Reference in New Issue
Block a user