[incubator-superset] branch master updated: chore: enable no-unused-vars and prefer-template eslint rules (#10350)
This is an automated email from the ASF dual-hosted git repository. erikrit pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 09de805 chore: enable no-unused-vars and prefer-template eslint rules (#10350) 09de805 is described below commit 09de8050174d48a3fde1c3a8e9a65a6ab21f8f0c Author: Erik Ritter AuthorDate: Thu Jul 16 19:13:59 2020 -0700 chore: enable no-unused-vars and prefer-template eslint rules (#10350) --- superset-frontend/.eslintrc.js| 6 +- superset-frontend/package.json| 1 - superset-frontend/spec/__mocks__/svgrMock.js | 2 -- .../spec/javascripts/components/AnchorLink_spec.jsx | 2 +- .../javascripts/components/ColumnTypeLabel_spec.jsx | 2 +- .../javascripts/components/ListView/ListView_spec.jsx | 2 -- .../javascripts/components/OnPasteSelect_spec.jsx | 7 +-- .../components/RefreshIntervalModal_spec.jsx | 2 +- .../explore/components/ExploreChartHeader_spec.jsx| 1 - .../explore/components/MetricsControl_spec.jsx| 2 +- .../messageToasts/components/Toast_spec.jsx | 1 - .../spec/javascripts/sqllab/SqlEditor_spec.jsx| 1 - .../spec/javascripts/sqllab/actions/sqlLab_spec.js| 2 +- superset-frontend/src/CRUD/CollectionTable.jsx| 2 +- superset-frontend/src/SqlLab/actions/sqlLab.js| 4 ++-- .../src/SqlLab/components/HighlightedSql.jsx | 2 +- .../src/SqlLab/components/QuerySearch.jsx | 4 ++-- superset-frontend/src/SqlLab/components/ResultSet.tsx | 2 +- .../src/SqlLab/components/ShareSqlLabQuery.jsx| 7 +++ .../src/SqlLab/components/TabStatusIcon.jsx | 2 +- .../src/SqlLab/components/TabbedSqlEditors.jsx| 2 +- superset-frontend/src/chart/ChartRenderer.jsx | 1 - superset-frontend/src/chart/chartAction.js| 2 -- superset-frontend/src/chart/chartReducer.js | 19 --- superset-frontend/src/components/AlteredSliceTag.jsx | 1 - .../components/FilterableTable/FilterableTable.tsx| 2 +- superset-frontend/src/components/Link.tsx | 2 +- superset-frontend/src/components/PopoverSection.jsx | 2 +- superset-frontend/src/components/TableLoader.jsx | 4 ++-- superset-frontend/src/components/TableSelector.jsx| 6 +++--- superset-frontend/src/components/VictoryTheme.js | 2 -- .../dashboard/components/gridComponents/Markdown.jsx | 2 +- superset-frontend/src/explore/AdhocFilter.js | 2 +- superset-frontend/src/explore/AdhocMetric.js | 2 +- superset-frontend/src/explore/App.jsx | 2 +- .../AdhocFilterEditPopoverSimpleTabContent.jsx| 4 ++-- .../AdhocFilterEditPopoverSqlTabContent.jsx | 2 +- .../src/explore/components/AdhocMetricEditPopover.jsx | 4 ++-- .../src/explore/components/AdhocMetricOption.jsx | 1 - .../src/explore/components/ControlPanelsContainer.jsx | 5 + .../src/explore/components/EmbedCodeButton.jsx| 6 +++--- .../src/explore/components/ExploreViewContainer.jsx | 2 +- .../components/controls/AdhocFilterControl.jsx| 4 ++-- .../explore/components/controls/DateFilterControl.jsx | 3 +-- .../explore/components/controls/MetricsControl.jsx| 4 ++-- .../components/controls/SelectAsyncControl.jsx| 2 +- .../src/explore/components/controls/SelectControl.jsx | 1 - .../explore/components/controls/ViewportControl.jsx | 8 +++- .../src/explore/controlPanels/DeckHex.js | 5 + .../src/explore/controlPanels/Shared_DeckGL.jsx | 11 +-- superset-frontend/src/explore/controlUtils.js | 1 - superset-frontend/src/explore/controls.jsx| 8 ++-- superset-frontend/src/explore/exploreUtils.js | 1 - superset-frontend/src/modules/utils.js| 2 +- superset-frontend/src/setup/setupApp.ts | 4 ++-- superset-frontend/src/utils/common.js | 2 +- 56 files changed, 66 insertions(+), 119 deletions(-) diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index 6b28a21..b40dabe 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -34,7 +34,7 @@ module.exports = { rules: { 'import/no-unresolved': 0, 'global-require': 0, - } + }, }, { files: ['*.ts', '*.tsx'], @@ -88,10 +88,8 @@ module.exports = { 'no-prototype-builtins': 0, 'no-restricted-properties': 0, 'no-restricted-syntax': 0, -'no-unused-vars': 0, 'padded-blocks': 0, 'prefer-arrow-callback': 0, -'prefer-template': 0, 'react/forbid-prop-types': 0, 'react/jsx-filename-extension': [1, { extensions: ['.jsx', '.tsx'] }],
[incubator-superset] branch master updated: feat(listviews): SIP-34 Bulk Select (#10298)
This is an automated email from the ASF dual-hosted git repository. tai pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 0eee678 feat(listviews): SIP-34 Bulk Select (#10298) 0eee678 is described below commit 0eee6785a812cfa65276cd2bfbef08da8ff357f3 Author: ʈᵃᵢ AuthorDate: Thu Jul 16 16:07:49 2020 -0700 feat(listviews): SIP-34 Bulk Select (#10298) --- superset-frontend/jest.config.js | 1 + .../waitForComponentToPaint.ts}| 29 ++- .../components/ListView/ListView_spec.jsx | 70 ++-- .../dashboard/components/CodeModal_spec.jsx| 6 +- .../views/datasetList/DatasetList_spec.jsx | 81 - .../src/SqlLab/components/RunQueryActionButton.tsx | 4 +- .../src/components/{Button.jsx => Button.tsx} | 78 +--- .../src/components/ListView/ListView.tsx | 132 +- .../src/components/ListView/ListViewStyles.less| 9 + .../src/components/ListView/TableCollection.tsx| 6 +- superset-frontend/src/components/ListView/utils.ts | 2 + superset-frontend/src/components/Menu/Menu.jsx | 3 +- superset-frontend/src/components/Menu/SubMenu.tsx | 113 +--- .../src/views/chartList/ChartList.tsx | 56 +++--- .../src/views/dashboardList/DashboardList.tsx | 65 --- .../{DatasetModal.tsx => AddDatasetModal.tsx} | 16 +- .../src/views/datasetList/DatasetList.tsx | 199 + superset-frontend/webpack.config.js| 1 + 18 files changed, 570 insertions(+), 301 deletions(-) diff --git a/superset-frontend/jest.config.js b/superset-frontend/jest.config.js index ea190d1..18b05cc 100644 --- a/superset-frontend/jest.config.js +++ b/superset-frontend/jest.config.js @@ -23,6 +23,7 @@ module.exports = { '\\.(gif|ttf|eot)$': '/spec/__mocks__/fileMock.js', '\\.svg$': '/spec/__mocks__/svgrMock.js', '^src/(.*)$': '/src/$1', +'^spec/(.*)$': '/spec/$1', }, setupFilesAfterEnv: ['/spec/helpers/shim.js'], testURL: 'http://localhost', diff --git a/superset-frontend/spec/javascripts/dashboard/components/CodeModal_spec.jsx b/superset-frontend/spec/helpers/waitForComponentToPaint.ts similarity index 58% copy from superset-frontend/spec/javascripts/dashboard/components/CodeModal_spec.jsx copy to superset-frontend/spec/helpers/waitForComponentToPaint.ts index 297492e..2e57a80 100644 --- a/superset-frontend/spec/javascripts/dashboard/components/CodeModal_spec.jsx +++ b/superset-frontend/spec/helpers/waitForComponentToPaint.ts @@ -16,20 +16,19 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; -import { mount } from 'enzyme'; +import { ReactWrapper } from 'enzyme'; +import { act } from 'react-dom/test-utils'; -import CodeModal from 'src/dashboard/components/CodeModal'; - -describe('CodeModal', () => { - const mockedProps = { -triggerNode: , - }; - it('is valid', () => { -expect(React.isValidElement()).toBe(true); - }); - it('renders the trigger node', () => { -const wrapper = mount(); -expect(wrapper.find('.fa-edit')).toHaveLength(1); +// taken from: https://github.com/enzymejs/enzyme/issues/2073 +// There is currently and issue with enzyme and react-16's hooks +// that results in a race condition between tests and react hook updates. +// This function ensures tests run after all react updates are done. +export default async function waitForComponentToPaint( + wrapper: ReactWrapper, + amount = 0, +) { + await act(async () => { +await new Promise(resolve => setTimeout(resolve, amount)); +wrapper.update(); }); -}); +} diff --git a/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx b/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx index bb7b2d8..6f62e4e 100644 --- a/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx +++ b/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx @@ -22,13 +22,17 @@ import { act } from 'react-dom/test-utils'; import { MenuItem } from 'react-bootstrap'; import Select from 'src/components/Select'; import { QueryParamProvider } from 'use-query-params'; +import { supersetTheme, ThemeProvider } from '@superset-ui/style'; import ListView from 'src/components/ListView/ListView'; import ListViewFilters from 'src/components/ListView/Filters'; import ListViewPagination from 'src/components/ListView/Pagination'; import Pagination from 'src/components/Pagination'; +import Button from 'src/components/Button'; import { areArraysShallowEqual } from 'src/reduxUtils'; -import { supersetTheme, ThemeProvider } from '@superset-ui/style'; + +import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint'; +import IndeterminateCheckbox from
[incubator-superset] branch master updated: fix: modified by column on charts and dashboards (#10340)
This is an automated email from the ASF dual-hosted git repository. dpgaspar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 2b061fc fix: modified by column on charts and dashboards (#10340) 2b061fc is described below commit 2b061fc64b88831574878b6bd470d700a1527dec Author: Daniel Vaz Gaspar AuthorDate: Thu Jul 16 23:15:47 2020 +0100 fix: modified by column on charts and dashboards (#10340) --- superset-frontend/src/views/chartList/ChartList.tsx | 4 ++-- superset-frontend/src/views/dashboardList/DashboardList.tsx | 4 ++-- superset-frontend/src/welcome/DashboardTable.tsx| 4 ++-- superset/charts/api.py | 6 ++ superset/dashboards/api.py | 4 ++-- superset/models/helpers.py | 4 ++-- 6 files changed, 12 insertions(+), 14 deletions(-) diff --git a/superset-frontend/src/views/chartList/ChartList.tsx b/superset-frontend/src/views/chartList/ChartList.tsx index fc5f992..5f96eef 100644 --- a/superset-frontend/src/views/chartList/ChartList.tsx +++ b/superset-frontend/src/views/chartList/ChartList.tsx @@ -146,8 +146,8 @@ class ChartList extends React.PureComponent { }, }, }: any) => {changedByName}, - Header: t('Creator'), - accessor: 'changed_by_fk', + Header: t('Modified By'), + accessor: 'changed_by.first_name', }, { Cell: ({ diff --git a/superset-frontend/src/views/dashboardList/DashboardList.tsx b/superset-frontend/src/views/dashboardList/DashboardList.tsx index 95de66a..09c3cc5 100644 --- a/superset-frontend/src/views/dashboardList/DashboardList.tsx +++ b/superset-frontend/src/views/dashboardList/DashboardList.tsx @@ -161,8 +161,8 @@ class DashboardList extends React.PureComponent { }, }, }: any) => {changedByName}, - Header: t('Creator'), - accessor: 'changed_by_fk', + Header: t('Modified By'), + accessor: 'changed_by.first_name', }, { Cell: ({ diff --git a/superset-frontend/src/welcome/DashboardTable.tsx b/superset-frontend/src/welcome/DashboardTable.tsx index 430548a..971b54f 100644 --- a/superset-frontend/src/welcome/DashboardTable.tsx +++ b/superset-frontend/src/welcome/DashboardTable.tsx @@ -77,8 +77,8 @@ class DashboardTable extends React.PureComponent< }) => {dashboardTitle}, }, { - accessor: 'changed_by_fk', - Header: 'Creator', + accessor: 'changed_by.first_name', + Header: 'Modified By', Cell: ({ row: { original: { changed_by_name: changedByName, changedByUrl }, diff --git a/superset/charts/api.py b/superset/charts/api.py index 9f5f92e..6c8635b 100644 --- a/superset/charts/api.py +++ b/superset/charts/api.py @@ -106,8 +106,6 @@ class ChartRestApi(BaseSupersetModelRestApi): "slice_name", "url", "description", -"changed_by_fk", -"created_by_fk", "changed_by_name", "changed_by_url", "changed_by.first_name", @@ -124,12 +122,12 @@ class ChartRestApi(BaseSupersetModelRestApi): "params", "cache_timeout", ] -list_select_columns = list_columns + ["changed_on"] +list_select_columns = list_columns + ["changed_on", "changed_by_fk"] order_columns = [ "slice_name", "viz_type", "datasource_name", -"changed_by_fk", +"changed_by.first_name", "changed_on_delta_humanized", ] search_columns = ( diff --git a/superset/dashboards/api.py b/superset/dashboards/api.py index a62f67e..7afecc2 100644 --- a/superset/dashboards/api.py +++ b/superset/dashboards/api.py @@ -119,12 +119,12 @@ class DashboardRestApi(BaseSupersetModelRestApi): "owners.first_name", "owners.last_name", ] -list_select_columns = list_columns + ["changed_on"] +list_select_columns = list_columns + ["changed_on", "changed_by_fk"] order_columns = [ "dashboard_title", "changed_on_delta_humanized", "published", -"changed_by_fk", +"changed_by.first_name", ] add_columns = [ diff --git a/superset/models/helpers.py b/superset/models/helpers.py index 969669c..d903d27 100644 --- a/superset/models/helpers.py +++ b/superset/models/helpers.py @@ -366,8 +366,8 @@ class AuditMixinNullable(AuditMixin): @property def changed_by_name(self) -> str: -if self.created_by: -return escape("{}".format(self.created_by)) +if self.changed_by: +return escape("{}".format(self.changed_by)) return "" @renders("created_by")
[incubator-superset] branch master updated: tests: update test run doc and add some improvements (#10339)
This is an automated email from the ASF dual-hosted git repository. dpgaspar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new e4c9c73 tests: update test run doc and add some improvements (#10339) e4c9c73 is described below commit e4c9c7364bbcecdbbe008ce5e6ce9065c28b3dfc Author: Daniel Vaz Gaspar AuthorDate: Thu Jul 16 13:03:49 2020 +0100 tests: update test run doc and add some improvements (#10339) * fix: update tests/run.sh README to pytest and some improvements * update docs * nit * fix doc --- scripts/tests/README.md | 24 ++-- scripts/tests/run.sh| 33 +++-- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/scripts/tests/README.md b/scripts/tests/README.md index 430a155..18f3805 100644 --- a/scripts/tests/README.md +++ b/scripts/tests/README.md @@ -24,38 +24,50 @@ so prior to using this script make sure to launch the dev containers. You can use a different DB backend by defining `SUPERSET__SQLALCHEMY_DATABASE_URI` env var. +This script will not install any dependencies for you, so you must be on an already set virtualenv + ## Use: +To show all supported switches: +```$bash +scripts/tests/run.sh --help +``` + From the superset repo root directory: +- Example run all tests: +```$bash +scripts/tests/run.sh +``` + - Example run a single test module: ```$bash -scripts/tests/run.sh tests.charts.api_tests +scripts/tests/run.sh --module tests/charts/api_tests.py ``` - Example run a single test: ```$bash -scripts/tests/run.sh tests.charts.api_tests:ChartApiTests.test_get_charts +scripts/tests/run.sh --module tests/charts/api_tests.py::TestChartApi::test_get_charts ``` - Example run a single test, without any init procedures. Init procedures include: resetting test database, db upgrade, superset init, loading example data. If your tests are idempotent, after the first run, subsequent runs are really fast ```$bash -scripts/tests/run.sh tests.charts.api_tests:ChartApiTests.test_get_charts --no-init +scripts/tests/run.sh --module tests/charts/api_tests.py::TestChartApi::test_get_charts --no-init ``` - Example for not recreating the test DB (will still run all the tests init procedures) ```$bash -scripts/tests/run.sh tests.charts.api_tests:ChartApiTests.test_get_charts --no-reset-db +scripts/tests/run.sh --module tests/charts/api_tests.py::TestChartApi::test_get_charts --no-reset-db ``` - Example for not running tests just initialize the test DB (drop/create, upgrade and load examples) ```$bash -scripts/tests/run.sh . --no-tests +scripts/tests/run.sh --no-tests ``` - Example for just resetting the tests DB ```$bash -scripts/tests/run.sh . --reset-db +scripts/tests/run.sh --reset-db --no-tests ``` diff --git a/scripts/tests/run.sh b/scripts/tests/run.sh index aeffeb0..98206f4 100755 --- a/scripts/tests/run.sh +++ b/scripts/tests/run.sh @@ -59,19 +59,6 @@ function test_init() { pytest -s tests/load_examples_test.py } - -if [[ "$#" -eq "0" ]] -then - echo "No argument suplied" - echo - echo use: - echo "run.sh [options]" - echo "[options]:" - echo "--no-init: Dont restart docker and no db migrations, superset init and test data" - echo "--no-reset-db: Recreates test database (DROP, CREATE)" - exit 1 -fi - # # Init global vars # @@ -83,14 +70,20 @@ export SUPERSET_CONFIG=${SUPERSET_CONFIG:-tests.superset_test_config} RUN_INIT=1 RUN_RESET_DB=1 RUN_TESTS=1 -TEST_MODULE="${1}" - -# Shift to pass the first cmd parameter for the test module -shift 1 +TEST_MODULE="tests" PARAMS="" while (( "$#" )); do case "$1" in +--help) + echo Switches: + echo --no-init : Will not, reset the test DB, superset init and load examples + echo --no-reset-db: Will not reset the test DB + echo --no-tests: Will not run any test, by default reset the DB, superset init and load_examples + echo --reset-db: Just resets the test DB, will not run any test + echo --module: Run a specific test module: --module tests/charts/api_tests.py for example + exit 0 + ;; --no-init) RUN_INIT=0 RUN_RESET_DB=0 @@ -109,6 +102,10 @@ while (( "$#" )); do RUN_INIT=0 shift 1 ;; +--module) + TEST_MODULE=$2 + shift 2 + ;; --) # end argument parsing shift break @@ -145,5 +142,5 @@ fi if [ $RUN_TESTS -eq 1 ] then - pytest -s --ignore=load_examples_test "${TEST_MODULE}" + pytest -x -s --ignore=load_examples_test "${TEST_MODULE}" fi
svn commit: r40513 - in /dev/incubator/superset/0.37.0rc2: ./ apache-superset-incubating-0.37.0rc2-source.tar.gz apache-superset-incubating-0.37.0rc2-source.tar.gz.asc apache-superset-incubating-0.37.
Author: villebro Date: Thu Jul 16 09:29:33 2020 New Revision: 40513 Log: Release 0.37.0rc2 Added: dev/incubator/superset/0.37.0rc2/ dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz (with props) dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.asc dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.sha512 Added: dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz == Binary file - no diff available. Propchange: dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz -- svn:mime-type = application/octet-stream Added: dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.asc == --- dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.asc (added) +++ dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.asc Thu Jul 16 09:29:33 2020 @@ -0,0 +1,11 @@ +-BEGIN PGP SIGNATURE- + +iQFIBAABCAAyFiEE91al5Odv7Ftw0dAOPG1R6/JstFEFAl8QF0IUHHZpbGxlYnJv +QGFwYWNoZS5vcmcACgkQPG1R6/JstFHGGwgAkO+R1F+zA+dHU5r5SV2fGMJ+rXAA +0ymUI9Nl9w9o5VItY2zKZdzOfTHJ+md5osql+frbo8VqG+Rlf1iQhpGJ1Epd5Wq+ +UEO7quiygkzPZArmAMyq2GCWLwNFE/qABnB8U5VCDSZO3I94VP9jVMITrqdeTlZr +00bv+PjDZ2DgVBrcG66SeR096ZwqmjJLbryiqTdpZ9dOSvYykVCeEeC95tlIFAX9 +84mQp7UnOiW1yltAgXngRUcNbNz7PNkb3/T8Z6jkRVhQAlBFr/rM4vk64W75PnmY +vvrovupEpy7CY6m4i868wZ+zYqhEudlj19lasdHFGktDS9go/2neyS0+CQ== +=l8DM +-END PGP SIGNATURE- Added: dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.sha512 == --- dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.sha512 (added) +++ dev/incubator/superset/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz.sha512 Thu Jul 16 09:29:33 2020 @@ -0,0 +1,3 @@ +/Users/ville/svn/superset_dev/0.37.0rc2/apache-superset-incubating-0.37.0rc2-source.tar.gz: +FC45E274 ED8B69E5 6D90CCBB 3C4D24BB F32C797B F0F86330 BB3C534C 8D74AD8A A7F5D6F0 + 50905D54 774C840A 192A9E3F BA22B853 AD949600 0B20CDC9 59D18873
[incubator-superset] tag 0.37.0rc2 created (now d9ec47b)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a change to tag 0.37.0rc2 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git. at d9ec47b (commit) This tag includes the following new commits: new d9ec47b chore: add cherries to CHANGELOG.md The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
[incubator-superset] 01/01: chore: add cherries to CHANGELOG.md
This is an automated email from the ASF dual-hosted git repository. villebro pushed a commit to tag 0.37.0rc2 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git commit d9ec47bc632a289056c30f2ba5d9088c0b7d00cf Author: Ville Brofeldt AuthorDate: Thu Jul 16 11:53:01 2020 +0300 chore: add cherries to CHANGELOG.md --- CHANGELOG.md | 13 + 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index efde58c..38a150c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,19 @@ under the License. ## Change Log ### 0.37.0 (2020/07/11 08:07 +00:00) +- [#10336](https://github.com/apache/incubator-superset/pull/10336) fix: make __time an ok column name in SQL Lab (#10336) (@villebro) +- [#10325](https://github.com/apache/incubator-superset/pull/10325) fix(table-viz): value "undefined" for column.name (#10325) (@ktmud) +- [#10321](https://github.com/apache/incubator-superset/pull/10321) fix: humanised changed on UTC on dashboards and charts (#10321) (@dpgaspar) +- [#10317](https://github.com/apache/incubator-superset/pull/10317) chore: type welcome (#10317) (@etr2460) +- [#10278](https://github.com/apache/incubator-superset/pull/10278) chore: add typing to more sqllab components (#10278) (@etr2460) +- [#10282](https://github.com/apache/incubator-superset/pull/10282) chore: add typing to profile (#10282) (@etr2460) +- [#10310](https://github.com/apache/incubator-superset/pull/10310) fix: Bump FAB to 3.0.1 fix superset init (#10310) (@dpgaspar) +- [#10313](https://github.com/apache/incubator-superset/pull/10313) fix: leave null timestamp unformatted in view results table (#10313) (@villebro) +- [#10312](https://github.com/apache/incubator-superset/pull/10312) fix: fix csv and query result type and QueryObject schema (#10312) (@villebro) +- [#10300](https://github.com/apache/incubator-superset/pull/10300) fix(chart-data-api): improve chart data endpoint errors (#10300) (@villebro) +- [#10293](https://github.com/apache/incubator-superset/pull/10293) fix(table-viz): table chart time column should use default (#10293) (@ktmud) +- [#10299](https://github.com/apache/incubator-superset/pull/10299) fix(chart-data-api): case insensitive evaluation of filter op (#10299) (@villebro) +- [#10292](https://github.com/apache/incubator-superset/pull/10292) chore: improve release documentation (#10292) (@villebro) - [#10281](https://github.com/apache/incubator-superset/pull/10281) logo gets the vertically-centered flexbox treatment in jinja template (#10281) (@rusackas) - [#10178](https://github.com/apache/incubator-superset/pull/10178) style: new toast design closer to SIP-34 (#10178) (@lilykuang) - [#10258](https://github.com/apache/incubator-superset/pull/10258) feat: update delete modal for dataset (#10258) (@lilykuang)
[incubator-superset] 03/06: chore: type welcome (#10317)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a commit to branch 0.37 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git commit 2f2fb47721d83f1bb377ee829532284be28d1753 Author: Erik Ritter AuthorDate: Wed Jul 15 08:38:43 2020 -0700 chore: type welcome (#10317) --- superset-frontend/package-lock.json| 29 + superset-frontend/package.json | 2 + ...boardTable_spec.jsx => DashboardTable_spec.tsx} | 2 +- .../welcome/{Welcome_spec.jsx => Welcome_spec.tsx} | 14 ++- superset-frontend/src/profile/components/App.tsx | 4 +- .../src/profile/components/CreatedContent.tsx | 3 +- .../src/profile/components/Favorites.tsx | 3 +- .../src/profile/components/RecentActivity.tsx | 3 +- .../src/profile/components/Security.tsx| 4 +- .../src/profile/components/UserInfo.tsx| 4 +- superset-frontend/src/profile/types.ts | 24 --- .../{profile/types.ts => types/bootstrapTypes.ts} | 28 - superset-frontend/src/welcome/{App.jsx => App.tsx} | 2 +- .../{DashboardTable.jsx => DashboardTable.tsx} | 48 ++ .../src/welcome/{Welcome.jsx => Welcome.tsx} | 27 +++- .../src/welcome/{index.jsx => index.tsx} | 0 superset-frontend/webpack.config.js| 2 +- 17 files changed, 121 insertions(+), 78 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 135f6b4..aeabd74 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -7658,6 +7658,11 @@ "resolved": "https://registry.npmjs.org/@types/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz;, "integrity": "sha512-mky/O83TXmGY39P1H9YbUpjV6l6voRYlufqfFCvel8l1phuy8HRjdWc1rrPuN53ITBJlbyMSV6z3niOySO5pgQ==" }, +"@types/fetch-mock": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@types/fetch-mock/-/fetch-mock-7.3.2.tgz;, + "integrity": "sha512-NCEfv49jmDsBAixjMjEHKVgmVQlJ+uK56FOc+2roYPExnXCZDpi6mJOHQ3v23BiO84hBDStND9R2itJr7PNoow==" +}, "@types/glob": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz;, @@ -7678,6 +7683,11 @@ "@types/node": "*" } }, +"@types/history": { + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.6.tgz;, + "integrity": "sha512-GRTZLeLJ8ia00ZH8mxMO8t0aC9M1N9bN461Z2eaRurJo6Fpa+utgCwLzI4jQHcrdzuzp5WPN9jRwpsCQ1VhJ5w==" +}, "@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz;, @@ -7837,6 +7847,25 @@ "redux": "^3.6.0" } }, +"@types/react-router": { + "version": "5.1.8", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.8.tgz;, + "integrity": "sha512-HzOyJb+wFmyEhyfp4D4NYrumi+LQgQL/68HvJO+q6XtuHSDvw6Aqov7sCAhjbNq3bUPgPqbdvjXC5HeB2oEAPg==", + "requires": { +"@types/history": "*", +"@types/react": "*" + } +}, +"@types/react-router-dom": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.5.tgz;, + "integrity": "sha512-ArBM4B1g3BWLGbaGvwBGO75GNFbLDUthrDojV2vHLih/Tq8M+tgvY1DSwkuNrPSwdp/GUL93WSEpTZs8nVyJLw==", + "requires": { +"@types/history": "*", +"@types/react": "*", +"@types/react-router": "*" + } +}, "@types/react-select": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/@types/react-select/-/react-select-3.0.12.tgz;, diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 17fab51..742e82e 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -102,9 +102,11 @@ "@superset-ui/validator": "^0.14.9", "@types/classnames": "^2.2.9", "@types/enzyme": "^3.10.5", +"@types/fetch-mock": "^7.3.2", "@types/react-bootstrap": "^0.32.21", "@types/react-gravatar": "^2.6.8", "@types/react-json-tree": "^0.6.11", +"@types/react-router-dom": "^5.1.5", "@types/react-select": "^3.0.12", "@types/react-virtualized": "^9.21.10", "@types/react-window": "^1.8.2", diff --git a/superset-frontend/spec/javascripts/welcome/DashboardTable_spec.jsx b/superset-frontend/spec/javascripts/welcome/DashboardTable_spec.tsx similarity index 97% rename from superset-frontend/spec/javascripts/welcome/DashboardTable_spec.jsx rename to superset-frontend/spec/javascripts/welcome/DashboardTable_spec.tsx index e9cf957..5ded3fa 100644 --- a/superset-frontend/spec/javascripts/welcome/DashboardTable_spec.jsx +++
[incubator-superset] 04/06: fix: humanised changed on UTC on dashboards and charts (#10321)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a commit to branch 0.37 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git commit c57df314d7bab3720f4378e2909b2604f2151a3b Author: Daniel Vaz Gaspar AuthorDate: Wed Jul 15 19:09:32 2020 +0100 fix: humanised changed on UTC on dashboards and charts (#10321) * fix: API marshmallow3 drop utc for naive datetime fields * fix: API marshmallow3 drop utc for naive datetime fields * fix, tests * isort and test * black * add and fix test * fix comment --- .../javascripts/views/chartList/ChartList_spec.jsx | 2 +- .../views/dashboardList/DashboardList_spec.jsx | 5 +-- .../src/views/chartList/ChartList.tsx | 9 +++-- .../src/views/dashboardList/DashboardList.tsx | 11 +++--- superset-frontend/src/welcome/DashboardTable.tsx | 11 +++--- superset/charts/api.py | 8 ++--- superset/dashboards/api.py | 12 +-- superset/models/helpers.py | 10 ++ tests/charts/api_tests.py | 30 tests/dashboards/api_tests.py | 41 +++--- 10 files changed, 109 insertions(+), 30 deletions(-) diff --git a/superset-frontend/spec/javascripts/views/chartList/ChartList_spec.jsx b/superset-frontend/spec/javascripts/views/chartList/ChartList_spec.jsx index a385faf..695b74e 100644 --- a/superset-frontend/spec/javascripts/views/chartList/ChartList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/chartList/ChartList_spec.jsx @@ -105,7 +105,7 @@ describe('ChartList', () => { const callsD = fetchMock.calls(/chart\/\?q/); expect(callsD).toHaveLength(1); expect(callsD[0][0]).toMatchInlineSnapshot( - `"http://localhost/api/v1/chart/?q=(order_column:changed_on,order_direction:desc,page:0,page_size:25)"`, + `"http://localhost/api/v1/chart/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:25)"`, ); }); }); diff --git a/superset-frontend/spec/javascripts/views/dashboardList/DashboardList_spec.jsx b/superset-frontend/spec/javascripts/views/dashboardList/DashboardList_spec.jsx index ca35c5d..5de6ba3 100644 --- a/superset-frontend/spec/javascripts/views/dashboardList/DashboardList_spec.jsx +++ b/superset-frontend/spec/javascripts/views/dashboardList/DashboardList_spec.jsx @@ -43,7 +43,8 @@ const mockDashboards = [...new Array(3)].map((_, i) => ({ changed_by_url: 'changed_by_url', changed_by_fk: 1, published: true, - changed_on: new Date().toISOString(), + changed_on_utc: new Date().toISOString(), + changed_on_delta_humanized: '5 minutes ago', owners: [{ first_name: 'admin', last_name: 'admin_user' }], })); @@ -95,7 +96,7 @@ describe('DashboardList', () => { const callsD = fetchMock.calls(/dashboard\/\?q/); expect(callsD).toHaveLength(1); expect(callsD[0][0]).toMatchInlineSnapshot( - `"http://localhost/api/v1/dashboard/?q=(order_column:changed_on,order_direction:desc,page:0,page_size:25)"`, + `"http://localhost/api/v1/dashboard/?q=(order_column:changed_on_delta_humanized,order_direction:desc,page:0,page_size:25)"`, ); }); it('edits', () => { diff --git a/superset-frontend/src/views/chartList/ChartList.tsx b/superset-frontend/src/views/chartList/ChartList.tsx index 57cfd82..fc5f992 100644 --- a/superset-frontend/src/views/chartList/ChartList.tsx +++ b/superset-frontend/src/views/chartList/ChartList.tsx @@ -19,7 +19,6 @@ import { SupersetClient } from '@superset-ui/connection'; import { t } from '@superset-ui/translation'; import { getChartMetadataRegistry } from '@superset-ui/chart'; -import moment from 'moment'; import PropTypes from 'prop-types'; import React from 'react'; import rison from 'rison'; @@ -108,7 +107,7 @@ class ChartList extends React.PureComponent { return isFeatureEnabled(FeatureFlag.LIST_VIEWS_SIP34_FILTER_UI); } - initialSort = [{ id: 'changed_on', desc: true }]; + initialSort = [{ id: 'changed_on_delta_humanized', desc: true }]; columns = [ { @@ -153,11 +152,11 @@ class ChartList extends React.PureComponent { { Cell: ({ row: { - original: { changed_on: changedOn }, + original: { changed_on_delta_humanized: changedOn }, }, - }: any) => {moment(changedOn).fromNow()}, + }: any) => {changedOn}, Header: t('Last Modified'), - accessor: 'changed_on', + accessor: 'changed_on_delta_humanized', }, { accessor: 'description', diff --git a/superset-frontend/src/views/dashboardList/DashboardList.tsx b/superset-frontend/src/views/dashboardList/DashboardList.tsx index 438c964..95de66a 100644 --- a/superset-frontend/src/views/dashboardList/DashboardList.tsx +++ b/superset-frontend/src/views/dashboardList/DashboardList.tsx @@ -18,7 +18,6 @@ */
[incubator-superset] 01/06: chore: add typing to profile (#10282)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a commit to branch 0.37 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git commit 2631b3882e58e56f2f4b163b351d2ec5f5043ce1 Author: Erik Ritter AuthorDate: Tue Jul 14 16:39:37 2020 -0700 chore: add typing to profile (#10282) --- superset-frontend/package-lock.json| 82 -- superset-frontend/package.json | 9 ++- .../profile/{App_spec.jsx => App_spec.tsx} | 0 ...tedContent_spec.jsx => CreatedContent_spec.tsx} | 0 ...itableTitle_spec.jsx => EditableTitle_spec.tsx} | 0 .../{Favorites_spec.jsx => Favorites_spec.tsx} | 0 ...ntActivity_spec.jsx => RecentActivity_spec.tsx} | 0 .../{Security_spec.jsx => Security_spec.tsx} | 0 .../{UserInfo_spec.jsx => UserInfo_spec.tsx} | 0 .../profile/{fixtures.jsx => fixtures.tsx} | 0 .../src/SqlLab/components/ResultSet.tsx| 2 + .../src/messageToasts/enhancers/withToasts.tsx | 4 +- superset-frontend/src/profile/{App.jsx => App.tsx} | 2 +- .../src/profile/components/{App.jsx => App.tsx}| 21 +++--- .../{CreatedContent.jsx => CreatedContent.tsx} | 24 ++- .../components/{Favorites.jsx => Favorites.tsx}| 24 ++- .../{RecentActivity.jsx => RecentActivity.tsx} | 56 +++ .../components/{Security.jsx => Security.tsx} | 12 ++-- .../src/profile/components/UserInfo.jsx| 75 .../src/profile/components/UserInfo.tsx| 76 .../src/profile/{index.jsx => index.tsx} | 0 .../profile/types.ts} | 56 ++- superset-frontend/webpack.config.js| 2 +- 23 files changed, 225 insertions(+), 220 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index b5c4dad..135f6b4 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -7678,22 +7678,6 @@ "@types/node": "*" } }, -"@types/hoist-non-react-statics": { - "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" - }, - "dependencies": { -"react-is": { - "version": "https://registry.npmjs.org/react-is/-/react-is-16.13.0.tgz;, - "integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==" -} - } -}, "@types/istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz;, @@ -7818,6 +7802,14 @@ "@types/react": "*" } }, +"@types/react-gravatar": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/@types/react-gravatar/-/react-gravatar-2.6.8.tgz;, + "integrity": "sha512-VMk0bF0w72l+opBm+EqLs0JqUG+hPowMBWCVGrbTwUWm/oDncvwNrf7P/ImwYwkTCKiLnU8Rc+/lyhehaIE/Rw==", + "requires": { +"@types/react": "*" + } +}, "@types/react-json-tree": { "version": "0.6.11", "resolved": "https://registry.npmjs.org/@types/react-json-tree/-/react-json-tree-0.6.11.tgz;, @@ -7836,31 +7828,13 @@ } }, "@types/react-redux": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-7.1.7.tgz;, - "integrity": "sha512-U+WrzeFfI83+evZE2dkZ/oF/1vjIYgqrb5dGgedkqVV8HEfDFujNgWCwHL89TDuWKb47U0nTBT6PLGq4IIogWg==", + "version": "5.0.21", + "resolved": "https://registry.npmjs.org/@types/react-redux/-/react-redux-5.0.21.tgz;, + "integrity": "sha512-ewkOW4GjnyXq5L++T31utI8yRmwj8iCIahZohYi1Ef7Xkrw0V/q92ao7x20rm38FKgImDaCCsaRGWfCJmF/Ukg==", "dev": true, "requires": { -"@types/hoist-non-react-statics": "^3.3.0", "@types/react": "*", -"hoist-non-react-statics": "^3.3.0", -"redux": "^4.0.0" - }, - "dependencies": { -"react-is": { - "version": "https://registry.npmjs.org/react-is/-/react-is-16.13.0.tgz;, - "integrity": "sha512-GFMtL0vHkiBv9HluwNZTggSn/sCyEt9n02aM0dSAjGGyqyNlAyftYm4phPxdvCigG15JreC5biwxCgTAJZ7yAA==" -}, -"redux": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/redux/-/redux-4.0.5.tgz;, - "integrity": "sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==", - "dev": true, - "requires": { -"loose-envify": "^1.4.0", -"symbol-observable":
[incubator-superset] 06/06: fix: make __time an ok column name in SQL Lab (#10336)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a commit to branch 0.37 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git commit 3f284eaa095c13b7b77c8aac9a78e7c5fbdeedc1 Author: Ville Brofeldt <33317356+ville...@users.noreply.github.com> AuthorDate: Thu Jul 16 10:34:50 2020 +0300 fix: make __time an ok column name in SQL Lab (#10336) --- superset-frontend/spec/javascripts/sqllab/fixtures.ts| 5 + superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx | 9 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/superset-frontend/spec/javascripts/sqllab/fixtures.ts b/superset-frontend/spec/javascripts/sqllab/fixtures.ts index 0cdcb09..d1cedf1 100644 --- a/superset-frontend/spec/javascripts/sqllab/fixtures.ts +++ b/superset-frontend/spec/javascripts/sqllab/fixtures.ts @@ -323,6 +323,11 @@ export const queryWithBadColumns = { }, { is_date: true, +name: '__TIME', +type: 'TIMESTAMP', + }, + { +is_date: true, name: '__TIMESTAMP', type: 'TIMESTAMP', }, diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx index 9fba238..8ecec6f 100644 --- a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx +++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx @@ -104,7 +104,7 @@ class ExploreResultsButton extends React.PureComponent { getInvalidColumns() { const re1 = /^[A-Za-z_]\w*$/; // starts with char or _, then only alphanum const re2 = /__\d+$/; // does not finish with __ and then a number which screams dup col name -const re3 = /^__/; // is not a reserved column name e.g. __timestamp +const re3 = /^__timestamp/i; // is not a reserved temporal column alias return this.props.query.results.selected_columns .map(col => col.name) @@ -199,9 +199,10 @@ class ExploreResultsButton extends React.PureComponent { AS my_alias ){' '} -{t(`limited to alphanumeric characters and underscores. Column aliases starting - with double underscores or ending with double underscores followed by a - numeric value are not allowed for reasons discussed in Github issue #5739. +{t(`limited to alphanumeric characters and underscores. The alias "__timestamp" + used as for the temporal expression and column aliases ending with + double underscores followed by a numeric value are not allowed for reasons + discussed in Github issue #5739. `)} );
[incubator-superset] branch 0.37 updated (791d787 -> 3f284ea)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a change to branch 0.37 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git. from 791d787 fix: Bump FAB to 3.0.1 fix superset init (#10310) new 2631b38 chore: add typing to profile (#10282) new 9f0d456 chore: add typing to more sqllab components (#10278) new 2f2fb47 chore: type welcome (#10317) new c57df31 fix: humanised changed on UTC on dashboards and charts (#10321) new 08d43b1 fix(table-viz): value "undefined" for column.name (#10325) new 3f284ea fix: make __time an ok column name in SQL Lab (#10336) The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: superset-frontend/package-lock.json| 138 + superset-frontend/package.json | 13 +- .../profile/{App_spec.jsx => App_spec.tsx} | 0 ...tedContent_spec.jsx => CreatedContent_spec.tsx} | 0 ...itableTitle_spec.jsx => EditableTitle_spec.tsx} | 0 .../{Favorites_spec.jsx => Favorites_spec.tsx} | 0 ...ntActivity_spec.jsx => RecentActivity_spec.tsx} | 0 .../{Security_spec.jsx => Security_spec.tsx} | 0 .../{UserInfo_spec.jsx => UserInfo_spec.tsx} | 0 .../profile/{fixtures.jsx => fixtures.tsx} | 0 ...lumnElement_spec.jsx => ColumnElement_spec.tsx} | 0 .../sqllab/{fixtures.js => fixtures.ts}| 14 ++- .../javascripts/views/chartList/ChartList_spec.jsx | 2 +- .../views/dashboardList/DashboardList_spec.jsx | 5 +- ...boardTable_spec.jsx => DashboardTable_spec.tsx} | 2 +- .../welcome/{Welcome_spec.jsx => Welcome_spec.tsx} | 14 ++- .../{ColumnElement.jsx => ColumnElement.tsx} | 23 ++-- .../src/SqlLab/components/ExploreResultsButton.jsx | 9 +- .../src/SqlLab/components/ResultSet.tsx| 2 + .../SqlLab/components/{ShowSQL.jsx => ShowSQL.tsx} | 74 +-- .../src/SqlLab/{constants.js => constants.ts} | 0 .../src/{welcome/index.jsx => SqlLab/index.tsx}| 0 .../src/messageToasts/enhancers/withToasts.tsx | 4 +- superset-frontend/src/profile/{App.jsx => App.tsx} | 2 +- .../src/profile/components/{App.jsx => App.tsx}| 21 ++-- .../{CreatedContent.jsx => CreatedContent.tsx} | 25 ++-- .../components/{Favorites.jsx => Favorites.tsx}| 25 ++-- .../{RecentActivity.jsx => RecentActivity.tsx} | 57 - .../components/{Security.jsx => Security.tsx} | 12 +- .../src/profile/components/UserInfo.jsx| 75 --- .../src/profile/components/UserInfo.tsx| 76 .../src/profile/{index.jsx => index.tsx} | 0 .../src/{types/Chart.ts => profile/types.ts} | 25 ++-- .../src/types/{Chart.ts => bootstrapTypes.ts} | 33 +++-- .../src/views/chartList/ChartList.tsx | 9 +- .../src/views/dashboardList/DashboardList.tsx | 11 +- superset-frontend/src/welcome/{App.jsx => App.tsx} | 2 +- .../{DashboardTable.jsx => DashboardTable.tsx} | 57 ++--- .../src/welcome/{Welcome.jsx => Welcome.tsx} | 27 ++-- .../src/{SqlLab/index.jsx => welcome/index.tsx}| 0 superset-frontend/webpack.config.js| 6 +- superset/charts/api.py | 8 +- superset/dashboards/api.py | 12 +- superset/models/helpers.py | 10 ++ tests/charts/api_tests.py | 30 + tests/dashboards/api_tests.py | 41 +- 46 files changed, 514 insertions(+), 350 deletions(-) rename superset-frontend/spec/javascripts/profile/{App_spec.jsx => App_spec.tsx} (100%) rename superset-frontend/spec/javascripts/profile/{CreatedContent_spec.jsx => CreatedContent_spec.tsx} (100%) rename superset-frontend/spec/javascripts/profile/{EditableTitle_spec.jsx => EditableTitle_spec.tsx} (100%) rename superset-frontend/spec/javascripts/profile/{Favorites_spec.jsx => Favorites_spec.tsx} (100%) rename superset-frontend/spec/javascripts/profile/{RecentActivity_spec.jsx => RecentActivity_spec.tsx} (100%) rename superset-frontend/spec/javascripts/profile/{Security_spec.jsx => Security_spec.tsx} (100%) rename superset-frontend/spec/javascripts/profile/{UserInfo_spec.jsx => UserInfo_spec.tsx} (100%) rename superset-frontend/spec/javascripts/profile/{fixtures.jsx => fixtures.tsx} (100%) rename superset-frontend/spec/javascripts/sqllab/{ColumnElement_spec.jsx => ColumnElement_spec.tsx} (100%) rename superset-frontend/spec/javascripts/sqllab/{fixtures.js => fixtures.ts} (96%) rename superset-frontend/spec/javascripts/welcome/{DashboardTable_spec.jsx => DashboardTable_spec.tsx} (97%) rename
[incubator-superset] 02/06: chore: add typing to more sqllab components (#10278)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a commit to branch 0.37 in repository https://gitbox.apache.org/repos/asf/incubator-superset.git commit 9f0d456b6a72210aab29fce2740db454ca5e44a7 Author: Erik Ritter AuthorDate: Tue Jul 14 16:39:56 2020 -0700 chore: add typing to more sqllab components (#10278) --- ...lumnElement_spec.jsx => ColumnElement_spec.tsx} | 0 .../sqllab/{fixtures.js => fixtures.ts}| 9 +-- .../{ColumnElement.jsx => ColumnElement.tsx} | 23 +-- .../SqlLab/components/{ShowSQL.jsx => ShowSQL.tsx} | 74 ++ .../src/SqlLab/{constants.js => constants.ts} | 0 .../src/SqlLab/{index.jsx => index.tsx}| 0 superset-frontend/webpack.config.js| 2 +- 7 files changed, 54 insertions(+), 54 deletions(-) diff --git a/superset-frontend/spec/javascripts/sqllab/ColumnElement_spec.jsx b/superset-frontend/spec/javascripts/sqllab/ColumnElement_spec.tsx similarity index 100% rename from superset-frontend/spec/javascripts/sqllab/ColumnElement_spec.jsx rename to superset-frontend/spec/javascripts/sqllab/ColumnElement_spec.tsx diff --git a/superset-frontend/spec/javascripts/sqllab/fixtures.js b/superset-frontend/spec/javascripts/sqllab/fixtures.ts similarity index 97% rename from superset-frontend/spec/javascripts/sqllab/fixtures.js rename to superset-frontend/spec/javascripts/sqllab/fixtures.ts index e7503ee..0cdcb09 100644 --- a/superset-frontend/spec/javascripts/sqllab/fixtures.js +++ b/superset-frontend/spec/javascripts/sqllab/fixtures.ts @@ -18,6 +18,7 @@ */ import sinon from 'sinon'; import * as actions from 'src/SqlLab/actions/sqlLab'; +import { ColumnKeyTypeType } from 'src/SqlLab/components/ColumnElement'; export const mockedActions = sinon.stub({ ...actions }); @@ -68,7 +69,7 @@ export const table = { keys: [ { column_names: ['id'], - type: 'pk', + type: 'pk' as ColumnKeyTypeType, name: null, }, ], @@ -84,14 +85,14 @@ export const table = { name: 'slices_ibfk_1', referred_columns: ['id'], referred_table: 'datasources', - type: 'fk', + type: 'fk' as ColumnKeyTypeType, referred_schema: 'carapal', options: {}, }, { unique: false, column_names: ['druid_datasource_id'], - type: 'index', + type: 'index' as ColumnKeyTypeType, name: 'druid_datasource_id', }, ], @@ -283,7 +284,7 @@ export const queries = [ export const queryWithBadColumns = { ...queries[0], results: { -data: queries[0].results.data, +data: queries[0].results?.data, selected_columns: [ { is_date: true, diff --git a/superset-frontend/src/SqlLab/components/ColumnElement.jsx b/superset-frontend/src/SqlLab/components/ColumnElement.tsx similarity index 80% rename from superset-frontend/src/SqlLab/components/ColumnElement.jsx rename to superset-frontend/src/SqlLab/components/ColumnElement.tsx index 1ee8579..f72bb3d 100644 --- a/superset-frontend/src/SqlLab/components/ColumnElement.jsx +++ b/superset-frontend/src/SqlLab/components/ColumnElement.tsx @@ -36,13 +36,22 @@ const tooltipTitleMap = { index: 'Index', }; -export default function ColumnElement(props) { - const col = props.column; - let name = col.name; +export type ColumnKeyTypeType = keyof typeof tooltipTitleMap; + +interface ColumnElementProps { + column: { +name: string; +keys?: { type: ColumnKeyTypeType }[]; +type: string; + }; +} + +export default function ColumnElement({ column }: ColumnElementProps) { + let name: React.ReactNode = column.name; let icons; - if (col.keys && col.keys.length > 0) { -name = {col.name}; -icons = col.keys.map((key, i) => ( + if (column.keys && column.keys.length > 0) { +name = {column.name}; +icons = column.keys.map((key, i) => ( - {col.type} + {column.type} ); diff --git a/superset-frontend/src/SqlLab/components/ShowSQL.jsx b/superset-frontend/src/SqlLab/components/ShowSQL.tsx similarity index 56% rename from superset-frontend/src/SqlLab/components/ShowSQL.jsx rename to superset-frontend/src/SqlLab/components/ShowSQL.tsx index 9b03069..002d164 100644 --- a/superset-frontend/src/SqlLab/components/ShowSQL.jsx +++ b/superset-frontend/src/SqlLab/components/ShowSQL.tsx @@ -17,58 +17,48 @@ * under the License. */ import React from 'react'; -import PropTypes from 'prop-types'; import SyntaxHighlighter, { registerLanguage, + // @ts-ignore } from 'react-syntax-highlighter/dist/light'; +// @ts-ignore import sql from 'react-syntax-highlighter/dist/languages/hljs/sql'; +// @ts-ignore import github from 'react-syntax-highlighter/dist/styles/hljs/github'; -import { t } from '@superset-ui/translation'; - import Link from '../../components/Link'; import
[incubator-superset] branch master updated: refactor: database API OpenAPI spec and location (#10303)
This is an automated email from the ASF dual-hosted git repository. dpgaspar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 4529812 refactor: database API OpenAPI spec and location (#10303) 4529812 is described below commit 4529812a1000f2ef7d37a8a26310d3d535e503ba Author: Daniel Vaz Gaspar AuthorDate: Thu Jul 16 09:01:56 2020 +0100 refactor: database API OpenAPI spec and location (#10303) * refactor: database API OpenAPI spec and location * fix isort and license * fix description --- superset/app.py| 2 +- superset/databases/__init__.py | 16 +++ superset/{views/database => databases}/api.py | 112 - .../{views/database => databases}/decorators.py| 0 superset/databases/schemas.py | 79 +++ 5 files changed, 114 insertions(+), 95 deletions(-) diff --git a/superset/app.py b/superset/app.py index e870788..d40923b 100644 --- a/superset/app.py +++ b/superset/app.py @@ -158,7 +158,7 @@ class SupersetAppInitializer: Dashboard, DashboardModelViewAsync, ) -from superset.views.database.api import DatabaseRestApi +from superset.databases.api import DatabaseRestApi from superset.views.database.views import ( DatabaseView, CsvToDatabaseView, diff --git a/superset/databases/__init__.py b/superset/databases/__init__.py new file mode 100644 index 000..13a8339 --- /dev/null +++ b/superset/databases/__init__.py @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. diff --git a/superset/views/database/api.py b/superset/databases/api.py similarity index 69% rename from superset/views/database/api.py rename to superset/databases/api.py index 2caed02..0b8321e 100644 --- a/superset/views/database/api.py +++ b/superset/databases/api.py @@ -21,13 +21,16 @@ from flask_appbuilder.models.sqla.interface import SQLAInterface from sqlalchemy.exc import NoSuchTableError, SQLAlchemyError from superset import event_logger +from superset.databases.decorators import check_datasource_access +from superset.databases.schemas import ( +SelectStarResponseSchema, +TableMetadataResponseSchema, +) from superset.models.core import Database from superset.typing import FlaskResponse from superset.utils.core import error_msg_from_exception from superset.views.base_api import BaseSupersetModelRestApi -from superset.views.database.decorators import check_datasource_access from superset.views.database.filters import DatabaseFilter -from superset.views.database.mixins import DatabaseMixin from superset.views.database.validators import sqlalchemy_uri_validator @@ -63,9 +66,8 @@ def get_table_metadata( database: Database, table_name: str, schema_name: Optional[str] ) -> Dict[str, Any]: """ -Get table metadata information, including type, pk, fks. -This function raises SQLAlchemyError when a schema is not found. - +Get table metadata information, including type, pk, fks. +This function raises SQLAlchemyError when a schema is not found. :param database: The database model :param table_name: Table name @@ -110,7 +112,7 @@ def get_table_metadata( } -class DatabaseRestApi(DatabaseMixin, BaseSupersetModelRestApi): +class DatabaseRestApi(BaseSupersetModelRestApi): datamodel = SQLAInterface(Database) include_route_methods = {"get_list", "table_metadata", "select_star"} @@ -141,13 +143,15 @@ class DatabaseRestApi(DatabaseMixin, BaseSupersetModelRestApi): "backend", "function_names", ] -show_columns = list_columns - # Removes the local limit for the page size max_page_size = -1 validators_columns = {"sqlalchemy_uri": sqlalchemy_uri_validator} openapi_spec_tag = "Database" +openapi_spec_component_schemas = ( +TableMetadataResponseSchema, +SelectStarResponseSchema, +) @expose("//table///", methods=["GET"]) @protect() @@ -179,87 +183,11 @@ class
[incubator-superset] branch master updated: fix: make __time an ok column name in SQL Lab (#10336)
This is an automated email from the ASF dual-hosted git repository. villebro pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-superset.git The following commit(s) were added to refs/heads/master by this push: new 611dd7a fix: make __time an ok column name in SQL Lab (#10336) 611dd7a is described below commit 611dd7a8f63bc4105fd0b5c10c6a8efd6eae6fca Author: Ville Brofeldt <33317356+ville...@users.noreply.github.com> AuthorDate: Thu Jul 16 10:34:50 2020 +0300 fix: make __time an ok column name in SQL Lab (#10336) --- superset-frontend/spec/javascripts/sqllab/fixtures.ts| 5 + superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx | 9 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/superset-frontend/spec/javascripts/sqllab/fixtures.ts b/superset-frontend/spec/javascripts/sqllab/fixtures.ts index 0cdcb09..d1cedf1 100644 --- a/superset-frontend/spec/javascripts/sqllab/fixtures.ts +++ b/superset-frontend/spec/javascripts/sqllab/fixtures.ts @@ -323,6 +323,11 @@ export const queryWithBadColumns = { }, { is_date: true, +name: '__TIME', +type: 'TIMESTAMP', + }, + { +is_date: true, name: '__TIMESTAMP', type: 'TIMESTAMP', }, diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx index 9fba238..8ecec6f 100644 --- a/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx +++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton.jsx @@ -104,7 +104,7 @@ class ExploreResultsButton extends React.PureComponent { getInvalidColumns() { const re1 = /^[A-Za-z_]\w*$/; // starts with char or _, then only alphanum const re2 = /__\d+$/; // does not finish with __ and then a number which screams dup col name -const re3 = /^__/; // is not a reserved column name e.g. __timestamp +const re3 = /^__timestamp/i; // is not a reserved temporal column alias return this.props.query.results.selected_columns .map(col => col.name) @@ -199,9 +199,10 @@ class ExploreResultsButton extends React.PureComponent { AS my_alias ){' '} -{t(`limited to alphanumeric characters and underscores. Column aliases starting - with double underscores or ending with double underscores followed by a - numeric value are not allowed for reasons discussed in Github issue #5739. +{t(`limited to alphanumeric characters and underscores. The alias "__timestamp" + used as for the temporal expression and column aliases ending with + double underscores followed by a numeric value are not allowed for reasons + discussed in Github issue #5739. `)} );