diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index 5494dec8f..3c5690319 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -19,7 +19,7 @@ jobs: FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }} run: | set -eo pipefail - if [[ "${{github.event_name}}" != "pull_request" ]]; then + if [[ "${{github.event_name}}" != "pull_request" ]]; then ./scripts/fossa.sh exit 0 fi @@ -30,7 +30,7 @@ jobs: cat< DATE_SUB(NOW(), INTERVAL 30 DAY)``. It can also support multiple -conditions: ``client_id = 6 AND advertiser="foo"``, etc. +The ``clause`` field can contain arbitrary text which is then added to the generated +SQL statement's ``WHERE`` clause. So you could even do something like create a +filter for the last 30 days and apply it to a specific role, with a clause like +``date_field > DATE_SUB(NOW(), INTERVAL 30 DAY)``. It can also support multiple +conditions: ``client_id = 6 AND advertiser="foo"``, etc. -All relevant ``Row level security filters`` will be ANDed together, so it's -possible to create a situation where two roles conflict in such a way as to -limit a table subset to empty. For example, the filters ``client_id=4`` and -and ``client_id=5``, applied to a role, will result in users of that role having -``client_id=4 AND client_id=5`` added to their query, which can never be true. \ No newline at end of file +All relevant ``Row level security filters`` will be ANDed together, so it's +possible to create a situation where two roles conflict in such a way as to +limit a table subset to empty. For example, the filters ``client_id=4`` and +and ``client_id=5``, applied to a role, will result in users of that role having +``client_id=4 AND client_id=5`` added to their query, which can never be true. diff --git a/helm/superset/requirements.yaml b/helm/superset/requirements.yaml index 1f47d5a08..60bcc42b5 100644 --- a/helm/superset/requirements.yaml +++ b/helm/superset/requirements.yaml @@ -22,4 +22,4 @@ dependencies: - name: redis version: 10.3.4 repository: https://kubernetes-charts.storage.googleapis.com/ - condition: redis.enabled \ No newline at end of file + condition: redis.enabled diff --git a/helm/superset/templates/secret-superset-config.yaml b/helm/superset/templates/secret-superset-config.yaml index 604bb2001..281ad9cf0 100644 --- a/helm/superset/templates/secret-superset-config.yaml +++ b/helm/superset/templates/secret-superset-config.yaml @@ -24,7 +24,7 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" type: Opaque -data: +data: superset_config.py: {{ include "superset-config" . | b64enc }} superset_init.sh: {{ tpl .Values.init.initscript . | b64enc }} superset_bootstrap.sh: {{ include "superset-bootstrap" . | b64enc }} diff --git a/requirements-dev.txt b/requirements-dev.txt index aaf6a99e9..d68a17b01 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -39,4 +39,3 @@ tox==3.11.1 pillow==7.0.0 openpyxl==3.0.3 # Pandas use openpyxl to write excel format(using in unittes) xlrd==1.2.0 - diff --git a/scripts/permissions_cleanup.py b/scripts/permissions_cleanup.py index 8c50cd007..c37d12445 100644 --- a/scripts/permissions_cleanup.py +++ b/scripts/permissions_cleanup.py @@ -22,7 +22,7 @@ from superset import sm def cleanup_permissions(): # 1. Clean up duplicates. pvms = sm.get_session.query(sm.permissionview_model).all() - print('# of permission view menues is: {}'.format(len(pvms))) + print("# of permission view menues is: {}".format(len(pvms))) pvms_dict = defaultdict(list) for pvm in pvms: pvms_dict[(pvm.permission, pvm.view_menu)].append(pvm) @@ -39,7 +39,7 @@ def cleanup_permissions(): sm.get_session.commit() pvms = sm.get_session.query(sm.permissionview_model).all() - print('STage 1: # of permission view menues is: {}'.format(len(pvms))) + print("STage 1: # of permission view menues is: {}".format(len(pvms))) # 2. Clean up None permissions or view menues pvms = sm.get_session.query(sm.permissionview_model).all() @@ -49,7 +49,7 @@ def cleanup_permissions(): sm.get_session.commit() pvms = sm.get_session.query(sm.permissionview_model).all() - print('Stage 2: # of permission view menues is: {}'.format(len(pvms))) + print("Stage 2: # of permission view menues is: {}".format(len(pvms))) # 3. Delete empty permission view menues from roles roles = sm.get_session.query(sm.role_model).all() diff --git a/superset-frontend/.storybook/main.js b/superset-frontend/.storybook/main.js index bb950c435..cf65d312d 100644 --- a/superset-frontend/.storybook/main.js +++ b/superset-frontend/.storybook/main.js @@ -38,4 +38,4 @@ module.exports = { }, plugins: [...config.plugins, ...customConfig.plugins], }), -}; \ No newline at end of file +}; diff --git a/superset-frontend/.storybook/preview.jsx b/superset-frontend/.storybook/preview.jsx index ac0f4f8f6..ee86557f1 100644 --- a/superset-frontend/.storybook/preview.jsx +++ b/superset-frontend/.storybook/preview.jsx @@ -29,4 +29,4 @@ const themeDecorator = storyFn => ( ); addDecorator(jsxDecorator); -addDecorator(themeDecorator); \ No newline at end of file +addDecorator(themeDecorator); diff --git a/superset-frontend/fonts/FiraCode/specimen.less b/superset-frontend/fonts/FiraCode/specimen.less index 03d7b8989..126496f81 100644 --- a/superset-frontend/fonts/FiraCode/specimen.less +++ b/superset-frontend/fonts/FiraCode/specimen.less @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - + @font-face { font-family: 'Fira Code'; src: url('woff2/FiraCode-Light.woff2') format('woff2'), diff --git a/superset-frontend/images/icons/cancel-x.svg b/superset-frontend/images/icons/cancel-x.svg index a1070fa51..0f1e33768 100644 --- a/superset-frontend/images/icons/cancel-x.svg +++ b/superset-frontend/images/icons/cancel-x.svg @@ -6,9 +6,9 @@ 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 @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/superset-frontend/images/icons/checkbox-half.svg b/superset-frontend/images/icons/checkbox-half.svg index dd25b2b2e..50411b421 100644 --- a/superset-frontend/images/icons/checkbox-half.svg +++ b/superset-frontend/images/icons/checkbox-half.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/checkbox-off.svg b/superset-frontend/images/icons/checkbox-off.svg index f537e642a..5835c1893 100644 --- a/superset-frontend/images/icons/checkbox-off.svg +++ b/superset-frontend/images/icons/checkbox-off.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/checkbox-on.svg b/superset-frontend/images/icons/checkbox-on.svg index 1033e3ab4..25e82d5e2 100644 --- a/superset-frontend/images/icons/checkbox-on.svg +++ b/superset-frontend/images/icons/checkbox-on.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/compass.svg b/superset-frontend/images/icons/compass.svg index 3c0c7dc81..7775d9b73 100644 --- a/superset-frontend/images/icons/compass.svg +++ b/superset-frontend/images/icons/compass.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/dataset_physical.svg b/superset-frontend/images/icons/dataset_physical.svg index 72040e815..28f46bb4c 100644 --- a/superset-frontend/images/icons/dataset_physical.svg +++ b/superset-frontend/images/icons/dataset_physical.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/dataset_virtual.svg b/superset-frontend/images/icons/dataset_virtual.svg index 51f136caa..ca15dcb63 100644 --- a/superset-frontend/images/icons/dataset_virtual.svg +++ b/superset-frontend/images/icons/dataset_virtual.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/error.svg b/superset-frontend/images/icons/error.svg index 03c19629e..b619c4876 100644 --- a/superset-frontend/images/icons/error.svg +++ b/superset-frontend/images/icons/error.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/pencil.svg b/superset-frontend/images/icons/pencil.svg index 6d1cbcb89..0cf5c9280 100644 --- a/superset-frontend/images/icons/pencil.svg +++ b/superset-frontend/images/icons/pencil.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/search.svg b/superset-frontend/images/icons/search.svg index 2f2b0c5b9..5b86f1385 100644 --- a/superset-frontend/images/icons/search.svg +++ b/superset-frontend/images/icons/search.svg @@ -6,9 +6,9 @@ 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 @@ -26,4 +26,4 @@ - \ No newline at end of file + diff --git a/superset-frontend/images/icons/sort-asc.svg b/superset-frontend/images/icons/sort-asc.svg index a6bd9d5aa..8981b6cff 100644 --- a/superset-frontend/images/icons/sort-asc.svg +++ b/superset-frontend/images/icons/sort-asc.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/sort-desc.svg b/superset-frontend/images/icons/sort-desc.svg index f56b7b29c..70dd0fa39 100644 --- a/superset-frontend/images/icons/sort-desc.svg +++ b/superset-frontend/images/icons/sort-desc.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/sort.svg b/superset-frontend/images/icons/sort.svg index 534cffc6d..119ca0299 100644 --- a/superset-frontend/images/icons/sort.svg +++ b/superset-frontend/images/icons/sort.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/trash.svg b/superset-frontend/images/icons/trash.svg index a80e19104..870af73b9 100644 --- a/superset-frontend/images/icons/trash.svg +++ b/superset-frontend/images/icons/trash.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/images/icons/warning.svg b/superset-frontend/images/icons/warning.svg index 9375f58de..df7fc6d11 100644 --- a/superset-frontend/images/icons/warning.svg +++ b/superset-frontend/images/icons/warning.svg @@ -6,9 +6,9 @@ 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 diff --git a/superset-frontend/src/views/CRUD/dataset/DatasetList.tsx b/superset-frontend/src/views/CRUD/dataset/DatasetList.tsx index 0964a0097..a9bebd7f3 100644 --- a/superset-frontend/src/views/CRUD/dataset/DatasetList.tsx +++ b/superset-frontend/src/views/CRUD/dataset/DatasetList.tsx @@ -623,10 +623,10 @@ const DatasetList: FunctionComponent = ({ {datasetCurrentlyDeleting && ( diff --git a/superset/bin/superset b/superset/bin/superset index 4b37e8339..e7b8de684 100755 --- a/superset/bin/superset +++ b/superset/bin/superset @@ -17,5 +17,5 @@ # under the License. from superset.cli import superset -if __name__ == '__main__': +if __name__ == "__main__": superset() diff --git a/superset/dashboards/schemas.py b/superset/dashboards/schemas.py index 258770586..ca9c25c1e 100644 --- a/superset/dashboards/schemas.py +++ b/superset/dashboards/schemas.py @@ -75,7 +75,6 @@ openapi_spec_methods_override = { "get": {"description": "Get a list of all possible owners for a dashboard."} }, } -""" Overrides GET methods OpenApi descriptions """ def validate_json(value: Union[bytes, bytearray, str]) -> None: diff --git a/superset/migrations/README b/superset/migrations/README index 98e4f9c44..2500aa1bc 100755 --- a/superset/migrations/README +++ b/superset/migrations/README @@ -1 +1 @@ -Generic single-database configuration. \ No newline at end of file +Generic single-database configuration. diff --git a/superset/migrations/versions/21e88bc06c02_annotation_migration.py b/superset/migrations/versions/21e88bc06c02_annotation_migration.py index 919d047b9..5593af0eb 100644 --- a/superset/migrations/versions/21e88bc06c02_annotation_migration.py +++ b/superset/migrations/versions/21e88bc06c02_annotation_migration.py @@ -14,14 +14,6 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -import json - -from alembic import op -from sqlalchemy import Column, Integer, or_, String, Text -from sqlalchemy.ext.declarative import declarative_base - -from superset import db - """migrate_old_annotation_layers Revision ID: 21e88bc06c02 @@ -29,6 +21,13 @@ Revises: 67a6ac9b727b Create Date: 2017-12-17 11:06:30.180267 """ +import json + +from alembic import op +from sqlalchemy import Column, Integer, or_, String, Text +from sqlalchemy.ext.declarative import declarative_base + +from superset import db # revision identifiers, used by Alembic. revision = "21e88bc06c02" diff --git a/superset/queries/schemas.py b/superset/queries/schemas.py index 04c003e10..daca322c6 100644 --- a/superset/queries/schemas.py +++ b/superset/queries/schemas.py @@ -25,4 +25,3 @@ openapi_spec_methods_override = { } }, } -""" Overrides GET methods OpenApi descriptions """ diff --git a/superset/templates/appbuilder/baselayout.html b/superset/templates/appbuilder/baselayout.html index 1199ab122..a08a052e5 100644 --- a/superset/templates/appbuilder/baselayout.html +++ b/superset/templates/appbuilder/baselayout.html @@ -55,4 +55,3 @@ {% endblock %} {% endblock %} - diff --git a/superset/templates/appbuilder/general/model/list.html b/superset/templates/appbuilder/general/model/list.html index 49f08d02c..866051dd1 100644 --- a/superset/templates/appbuilder/general/model/list.html +++ b/superset/templates/appbuilder/general/model/list.html @@ -33,4 +33,4 @@ {{ lib.panel_end() }} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/superset/templates/email/role_extended.txt b/superset/templates/email/role_extended.txt index 72eb337aa..89ba1b0f7 100644 --- a/superset/templates/email/role_extended.txt +++ b/superset/templates/email/role_extended.txt @@ -29,4 +29,4 @@ To see all your permissions please visit your profile page.

-Regards, Superset Admin. \ No newline at end of file +Regards, Superset Admin. diff --git a/superset/templates/email/role_granted.txt b/superset/templates/email/role_granted.txt index a6ca9ebc8..8027f41ac 100644 --- a/superset/templates/email/role_granted.txt +++ b/superset/templates/email/role_granted.txt @@ -33,4 +33,4 @@ To see all your permissions please visit your profile page.

-Regards, Superset Admin. \ No newline at end of file +Regards, Superset Admin. diff --git a/superset/templates/superset/basic.html b/superset/templates/superset/basic.html index a31574696..163d9480e 100644 --- a/superset/templates/superset/basic.html +++ b/superset/templates/superset/basic.html @@ -36,10 +36,10 @@ {% block head_meta %}{% endblock %} {% block head_css %} {% for favicon in favicons %} - {% endfor %} diff --git a/superset/templates/superset/export_dashboards.html b/superset/templates/superset/export_dashboards.html index 5ec6ff164..9744424b6 100644 --- a/superset/templates/superset/export_dashboards.html +++ b/superset/templates/superset/export_dashboards.html @@ -27,7 +27,7 @@ a.click(); document.body.removeChild(a); - window.location = '{{ dashboards_url }}'; + window.location = '{{ dashboards_url }}'; }; diff --git a/superset/templates/superset/fab_overrides/list_with_checkboxes.html b/superset/templates/superset/fab_overrides/list_with_checkboxes.html index 3d5fbaf77..2cea53022 100644 --- a/superset/templates/superset/fab_overrides/list_with_checkboxes.html +++ b/superset/templates/superset/fab_overrides/list_with_checkboxes.html @@ -97,4 +97,3 @@ {% endblock %} - diff --git a/superset/templates/superset/form_view/csv_to_database_view/edit.html b/superset/templates/superset/form_view/csv_to_database_view/edit.html index 9e6e542e2..ab647d4c2 100644 --- a/superset/templates/superset/form_view/csv_to_database_view/edit.html +++ b/superset/templates/superset/form_view/csv_to_database_view/edit.html @@ -61,4 +61,4 @@ } } -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/superset/templates/superset/form_view/excel_to_database_view/edit.html b/superset/templates/superset/form_view/excel_to_database_view/edit.html index dcfd6d2ce..fb7c43223 100644 --- a/superset/templates/superset/form_view/excel_to_database_view/edit.html +++ b/superset/templates/superset/form_view/excel_to_database_view/edit.html @@ -61,4 +61,4 @@ } } -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/superset/templates/superset/paper-theme.html b/superset/templates/superset/paper-theme.html index edf50137c..c4221be13 100644 --- a/superset/templates/superset/paper-theme.html +++ b/superset/templates/superset/paper-theme.html @@ -431,7 +431,7 @@

Alerts