From c84c912a3bf97838967df9739da70dd08fa69d9b Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Mon, 29 Apr 2024 16:27:45 +0500 Subject: [PATCH 1/7] upgrade clickhouse --- ...155841_fahad.khalid_fahad_clickhouse_30.md | 1 + .../0012_modify_course_enrollments.sql | 23 +++++++++++++++++++ .../0013_modify_course_block_completion.sql | 15 ++++++++++++ .../cairn/build/cairn-clickhouse/Dockerfile | 6 ++--- .../build/cairn-superset/cairn/bootstrap.py | 16 +++++++++---- 5 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md create mode 100644 tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql create mode 100644 tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0013_modify_course_block_completion.sql diff --git a/changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md b/changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md new file mode 100644 index 0000000..40caf76 --- /dev/null +++ b/changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md @@ -0,0 +1 @@ +- 💥[Feature] Upgrade Clickhouse version to `24.1.8.22` and fix query issues due to deprecation of Live views. (by @Fahadkhalid210) diff --git a/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql b/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql new file mode 100644 index 0000000..2552c17 --- /dev/null +++ b/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql @@ -0,0 +1,23 @@ +RENAME TABLE _openedx_course_enrollments TO openedx_course_enrollments; +RENAME TABLE _openedx_user_profiles TO openedx_user_profiles; +RENAME TABLE _openedx_users TO openedx_users; + +DROP TABLE course_enrollments; +CREATE VIEW course_enrollments AS +SELECT + openedx_course_enrollments.course_id AS course_id, + openedx_course_enrollments.created AS enrollment_created, + openedx_course_enrollments.is_active AS enrollment_is_active, + openedx_course_enrollments.mode AS enrollment_mode, + openedx_course_enrollments.user_id AS user_id, + openedx_users.username AS username, + openedx_users.email AS user_email, + openedx_user_profiles.year_of_birth AS user_year_of_birth, + openedx_user_profiles.gender AS user_gender, + openedx_user_profiles.level_of_education AS user_level_of_education, + openedx_user_profiles.city AS user_city, + openedx_user_profiles.state AS user_state, + openedx_user_profiles.country AS user_country +FROM openedx_course_enrollments +INNER JOIN openedx_user_profiles ON openedx_course_enrollments.user_id = openedx_user_profiles.user_id +INNER JOIN openedx_users ON openedx_course_enrollments.user_id = openedx_users.id; \ No newline at end of file diff --git a/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0013_modify_course_block_completion.sql b/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0013_modify_course_block_completion.sql new file mode 100644 index 0000000..523530b --- /dev/null +++ b/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0013_modify_course_block_completion.sql @@ -0,0 +1,15 @@ +RENAME TABLE _openedx_block_completion TO openedx_block_completion; + +DROP TABLE course_block_completion; + +CREATE VIEW course_block_completion AS +SELECT + openedx_block_completion.course_key AS course_id, + openedx_block_completion.block_key AS block_key, + openedx_block_completion.user_id AS user_id, + openedx_block_completion.completion AS completion, + course_blocks.position as position, + course_blocks.display_name as display_name, + course_blocks.full_name as full_name +FROM openedx_block_completion +INNER JOIN course_blocks ON openedx_block_completion.block_key = course_blocks.block_key; diff --git a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile index 32af310..bb24cfc 100644 --- a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile +++ b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile @@ -1,11 +1,11 @@ -# https://hub.docker.com/r/yandex/clickhouse-server/tags -FROM docker.io/yandex/clickhouse-server:22.1.3.7 +# https://hub.docker.com/r/clickhouse/clickhouse-server/tags +FROM docker.io/clickhouse/clickhouse-server:24.1.8.22 # The clickhouse repo is currently unavailable in some parts of the world. If we don't # remove this repo here then `apt update` will fail. Check if the problem is resolved with: # curl https://repo.yandex.ru/clickhouse/deb/stable/ # The above command should be a 200, and not a 404. -RUN rm /etc/apt/sources.list.d/clickhouse.list +# RUN rm /etc/apt/sources.list.d/clickhouse.list RUN apt update && apt install -y python3 COPY ./scripts /scripts RUN chmod a+x /scripts/* diff --git a/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py b/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py index 25ba62f..f88fab7 100644 --- a/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py +++ b/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py @@ -117,11 +117,17 @@ def grant_clickhouse_row_based_access(clickhouse_username, course_ids=None): for table in make_clickhouse_query("SHOW TABLES").split("\n"): if not table.startswith("_"): make_clickhouse_query( - f"""GRANT SELECT ON {table} TO '{clickhouse_username}';""" - ) - make_clickhouse_query( - f"""CREATE ROW POLICY OR REPLACE '{clickhouse_username}' ON {table} AS RESTRICTIVE FOR SELECT USING {condition} TO '{clickhouse_username}';""" - ) + f"""GRANT SELECT ON {table} TO '{clickhouse_username}';""" + ) + + if table in ["openedx_users", "openedx_user_profiles", "openedx_block_completion"]: + make_clickhouse_query( + f"""CREATE ROW POLICY OR REPLACE '{clickhouse_username}' ON {table} AS RESTRICTIVE FOR SELECT USING 1 TO '{clickhouse_username}';""" + ) + else: + make_clickhouse_query( + f"""CREATE ROW POLICY OR REPLACE '{clickhouse_username}' ON {table} AS RESTRICTIVE FOR SELECT USING {condition} TO '{clickhouse_username}';""" + ) def make_clickhouse_query(query): From 3007465f21ab2819d2692cea46c8a4c81ce8249a Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Tue, 30 Apr 2024 17:18:46 +0500 Subject: [PATCH 2/7] removed comments from docker --- tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile index bb24cfc..ab8edf9 100644 --- a/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile +++ b/tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile @@ -1,11 +1,6 @@ # https://hub.docker.com/r/clickhouse/clickhouse-server/tags FROM docker.io/clickhouse/clickhouse-server:24.1.8.22 -# The clickhouse repo is currently unavailable in some parts of the world. If we don't -# remove this repo here then `apt update` will fail. Check if the problem is resolved with: -# curl https://repo.yandex.ru/clickhouse/deb/stable/ -# The above command should be a 200, and not a 404. -# RUN rm /etc/apt/sources.list.d/clickhouse.list RUN apt update && apt install -y python3 COPY ./scripts /scripts RUN chmod a+x /scripts/* From 2b02ef803b7fb0ccdf4c8ccfb06699b3b74560b0 Mon Sep 17 00:00:00 2001 From: Fahad Khalid <79192414+FahadKhalid210@users.noreply.github.com> Date: Mon, 6 May 2024 11:05:35 +0500 Subject: [PATCH 3/7] Update 0012_modify_course_enrollments.sql --- .../clickhouse/migrations.d/0012_modify_course_enrollments.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql b/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql index 2552c17..75cc839 100644 --- a/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql +++ b/tutorcairn/templates/cairn/apps/clickhouse/migrations.d/0012_modify_course_enrollments.sql @@ -20,4 +20,4 @@ SELECT openedx_user_profiles.country AS user_country FROM openedx_course_enrollments INNER JOIN openedx_user_profiles ON openedx_course_enrollments.user_id = openedx_user_profiles.user_id -INNER JOIN openedx_users ON openedx_course_enrollments.user_id = openedx_users.id; \ No newline at end of file +INNER JOIN openedx_users ON openedx_course_enrollments.user_id = openedx_users.id; From 372e04309a70d5a00e672aef3b18d7504f5f90a5 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Tue, 16 Apr 2024 17:09:12 +0500 Subject: [PATCH 4/7] adde cors --- changelog.d/20240416_165758_fahad.khalid.md | 1 + .../templates/cairn/apps/superset/superset_config.py | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 changelog.d/20240416_165758_fahad.khalid.md diff --git a/changelog.d/20240416_165758_fahad.khalid.md b/changelog.d/20240416_165758_fahad.khalid.md new file mode 100644 index 0000000..26e2291 --- /dev/null +++ b/changelog.d/20240416_165758_fahad.khalid.md @@ -0,0 +1 @@ +- [Improvement] Added CORS for embeded Dashboards. (by @Fahadkhalid210) \ No newline at end of file diff --git a/tutorcairn/templates/cairn/apps/superset/superset_config.py b/tutorcairn/templates/cairn/apps/superset/superset_config.py index 30ae194..7de555f 100644 --- a/tutorcairn/templates/cairn/apps/superset/superset_config.py +++ b/tutorcairn/templates/cairn/apps/superset/superset_config.py @@ -162,4 +162,13 @@ class CeleryConfig: # pylint: disable=too-few-public-methods "EMBEDDED_SUPERSET": True } +# Embedded Dashboard CORS +ENABLE_CORS=True +CORS_OPTIONS={ + "supports_credentials": True, + "allow_headers": ["*"], + "resources": ["*"], + 'origins': ["{{ LMS_HOST }}","{{ CMS_HOST }}"], +} + {{ patch("cairn-superset-settings") }} From b0a96c50b8ef430c2d875226a31ea35a438f4c10 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Thu, 18 Apr 2024 17:14:33 +0500 Subject: [PATCH 5/7] update cors and readme --- README.rst | 7 +++++++ .../cairn/apps/superset/superset_config.py | 13 +++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index dd5e82d..e99b74a 100644 --- a/README.rst +++ b/README.rst @@ -240,6 +240,13 @@ Postgresql/Superset settings - ``CAIRN_POSTGRESQL_PASSWORD`` (default: ``"{{ 20|random_string }}"``): Postgresql password. - ``CAIRN_SUPERSET_SECRET_KEY`` (default: ``"{{ 20|random_string }}"``): randomly-generated secret key for the Superset frontend. +Add/Update Superset Configurations +---------------------------------- + +Use ``cairn-superset-settings`` patch to add or update `Superset configurations `__. +Then apply changes with:: + tutor local launch + Troubleshooting --------------- diff --git a/tutorcairn/templates/cairn/apps/superset/superset_config.py b/tutorcairn/templates/cairn/apps/superset/superset_config.py index 7de555f..a1fe4e9 100644 --- a/tutorcairn/templates/cairn/apps/superset/superset_config.py +++ b/tutorcairn/templates/cairn/apps/superset/superset_config.py @@ -163,12 +163,17 @@ class CeleryConfig: # pylint: disable=too-few-public-methods } # Embedded Dashboard CORS +OPENEDX_CMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}" + +if os.environ.get("FLASK_ENV") == "development": + OPENEDX_CMS_ROOT_URL = "http://{{ CMS_HOST }}:8001" + ENABLE_CORS=True CORS_OPTIONS={ - "supports_credentials": True, - "allow_headers": ["*"], - "resources": ["*"], - 'origins': ["{{ LMS_HOST }}","{{ CMS_HOST }}"], + "origins": [ + f"{OPENEDX_LMS_ROOT_URL}", + f"{OPENEDX_CMS_ROOT_URL}" + ], } {{ patch("cairn-superset-settings") }} From d816204b363087c0f8699afe3aafdebcfd958476 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Thu, 2 May 2024 11:35:28 +0500 Subject: [PATCH 6/7] improved code --- README.rst | 8 ++++++++ .../cairn/apps/superset/superset_config.py | 15 +++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index e99b74a..6809585 100644 --- a/README.rst +++ b/README.rst @@ -244,7 +244,15 @@ Add/Update Superset Configurations ---------------------------------- Use ``cairn-superset-settings`` patch to add or update `Superset configurations `__. + +e.g, to customize visualizations, add following configurations in ``cairn-superset-settings`` patch:: + + APP_NAME = "" + APP_ICON = "" + APP_ICON_WIDTH = + Then apply changes with:: + tutor local launch Troubleshooting diff --git a/tutorcairn/templates/cairn/apps/superset/superset_config.py b/tutorcairn/templates/cairn/apps/superset/superset_config.py index a1fe4e9..1aa11d6 100644 --- a/tutorcairn/templates/cairn/apps/superset/superset_config.py +++ b/tutorcairn/templates/cairn/apps/superset/superset_config.py @@ -84,6 +84,12 @@ db=REDIS_CACHE_DB, key_prefix="superset_results", ) +OPENEDX_LMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}" +OPENEDX_CMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}" + +if os.environ.get("FLASK_ENV") == "development": + OPENEDX_LMS_ROOT_URL = "http://{{ LMS_HOST }}:8000" + OPENEDX_CMS_ROOT_URL = "http://{{ CMS_HOST }}:8001" {% if CAIRN_ENABLE_SSO %} # Authentication @@ -91,10 +97,9 @@ # https://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-oauth from flask_appbuilder.security.manager import AUTH_OAUTH AUTH_TYPE = AUTH_OAUTH -OPENEDX_LMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}" + OPENEDX_SSO_CLIENT_ID = "{{ CAIRN_SSO_CLIENT_ID }}" if os.environ.get("FLASK_ENV") == "development": - OPENEDX_LMS_ROOT_URL = "http://{{ LMS_HOST }}:8000" OPENEDX_SSO_CLIENT_ID = "{{ CAIRN_SSO_CLIENT_ID }}-dev" OAUTH_PROVIDERS = [ { @@ -162,12 +167,6 @@ class CeleryConfig: # pylint: disable=too-few-public-methods "EMBEDDED_SUPERSET": True } -# Embedded Dashboard CORS -OPENEDX_CMS_ROOT_URL = "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ CMS_HOST }}" - -if os.environ.get("FLASK_ENV") == "development": - OPENEDX_CMS_ROOT_URL = "http://{{ CMS_HOST }}:8001" - ENABLE_CORS=True CORS_OPTIONS={ "origins": [ From 90a519c7ddeae6a05d333a17141f2cbb56989f27 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Thu, 6 Jun 2024 17:28:31 +0500 Subject: [PATCH 7/7] upgrade to redwood --- CHANGELOG.md | 9 +++++++++ changelog.d/20240212_115536_regis_pkg_resources.md | 1 - changelog.d/20240405_151230_fahad.khalid.md | 1 - changelog.d/20240416_165758_fahad.khalid.md | 1 - ...20240429_155841_fahad.khalid_fahad_clickhouse_30.md | 1 - setup.py | 4 ++-- tutorcairn/__about__.py | 2 +- .../templates/cairn/apps/superset/superset_config.py | 1 + .../templates/cairn/build/cairn-superset/Dockerfile | 10 +++++----- .../cairn/build/cairn-superset/cairn/bootstrap.py | 3 ++- .../templates/cairn/build/cairn-superset/cairn/ctl.py | 2 +- 11 files changed, 21 insertions(+), 14 deletions(-) delete mode 100644 changelog.d/20240212_115536_regis_pkg_resources.md delete mode 100644 changelog.d/20240405_151230_fahad.khalid.md delete mode 100644 changelog.d/20240416_165758_fahad.khalid.md delete mode 100644 changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 8654bc0..e4e4803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,15 @@ instructions, because git commits are used to generate release notes: + +## v18.0.0 (2024-06-20) + +- 💥[Feature] Upgrade to Redwood. (by @Fahadkhalid210) +- [Bugfix] Make plugin compatible with Python 3.12 by removing dependency on `pkg_resources`. (by @regisb) +- [Improvement] Update User Activity dataset query by extending time span to 120 seconds and selecting all events where course ID is not null to improve average time spent in course. (by @Fahadkhalid210) +- [Improvement] Added CORS for embedded Dashboards. (by @Fahadkhalid210) +- 💥[Feature] Upgrade Clickhouse to version 24.1.8.22 and fix query issues due to deprecation of live views. (by @Fahadkhalid210) + ## v17.1.0 (2024-02-09) diff --git a/changelog.d/20240212_115536_regis_pkg_resources.md b/changelog.d/20240212_115536_regis_pkg_resources.md deleted file mode 100644 index 35b6d20..0000000 --- a/changelog.d/20240212_115536_regis_pkg_resources.md +++ /dev/null @@ -1 +0,0 @@ -- [Bugfix] Make plugin compatible with Python 3.12 by removing dependency on `pkg_resources`. (by @regisb) diff --git a/changelog.d/20240405_151230_fahad.khalid.md b/changelog.d/20240405_151230_fahad.khalid.md deleted file mode 100644 index 83f660b..0000000 --- a/changelog.d/20240405_151230_fahad.khalid.md +++ /dev/null @@ -1 +0,0 @@ -- [Improvement] Update User Activity dataset query by extending time span to 120 seconds and selecting all events where course ID is not null to improve average time spent in course. (by @Fahadkhalid210) diff --git a/changelog.d/20240416_165758_fahad.khalid.md b/changelog.d/20240416_165758_fahad.khalid.md deleted file mode 100644 index 26e2291..0000000 --- a/changelog.d/20240416_165758_fahad.khalid.md +++ /dev/null @@ -1 +0,0 @@ -- [Improvement] Added CORS for embeded Dashboards. (by @Fahadkhalid210) \ No newline at end of file diff --git a/changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md b/changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md deleted file mode 100644 index 40caf76..0000000 --- a/changelog.d/20240429_155841_fahad.khalid_fahad_clickhouse_30.md +++ /dev/null @@ -1 +0,0 @@ -- 💥[Feature] Upgrade Clickhouse version to `24.1.8.22` and fix query issues due to deprecation of Live views. (by @Fahadkhalid210) diff --git a/setup.py b/setup.py index 6e1e20f..ce5caa5 100644 --- a/setup.py +++ b/setup.py @@ -41,8 +41,8 @@ def load_about(): packages=find_packages(exclude=["tests*"]), include_package_data=True, python_requires=">=3.8", - install_requires=["tutor>=17.0.0,<18.0.0"], - extras_require={"dev": ["tutor[dev]>=17.0.0,<18.0.0"]}, + install_requires=["tutor>=18.0.0,<19.0.0"], + extras_require={"dev": ["tutor[dev]>=18.0.0,<19.0.0"]}, entry_points={"tutor.plugin.v1": ["cairn = tutorcairn.plugin"]}, classifiers=[ "Development Status :: 5 - Production/Stable", diff --git a/tutorcairn/__about__.py b/tutorcairn/__about__.py index 1bef254..c6a8b8e 100644 --- a/tutorcairn/__about__.py +++ b/tutorcairn/__about__.py @@ -1 +1 @@ -__version__ = "17.1.0" +__version__ = "18.0.0" diff --git a/tutorcairn/templates/cairn/apps/superset/superset_config.py b/tutorcairn/templates/cairn/apps/superset/superset_config.py index 1aa11d6..27e4df0 100644 --- a/tutorcairn/templates/cairn/apps/superset/superset_config.py +++ b/tutorcairn/templates/cairn/apps/superset/superset_config.py @@ -41,6 +41,7 @@ "ru": {"flag": "ru", "name": "Russian"}, "sk": {"flag": "sk", "name": "Slovak"}, "sl": {"flag": "si", "name": "Slovenian"}, + "uk": {"flag": "uk", "name": "Ukranian"}, "zh": {"flag": "cn", "name": "Chinese"}, } {#- https://github.com/apache/superset/blob/master/docs/docs/contributing/translations.mdx#enabling-language-selection #} diff --git a/tutorcairn/templates/cairn/build/cairn-superset/Dockerfile b/tutorcairn/templates/cairn/build/cairn-superset/Dockerfile index dc5efaa..9ec0368 100644 --- a/tutorcairn/templates/cairn/build/cairn-superset/Dockerfile +++ b/tutorcairn/templates/cairn/build/cairn-superset/Dockerfile @@ -3,7 +3,7 @@ # https://github.com/apache/superset/releases # https://github.com/apache/superset/blob/master/Dockerfile # https://superset.apache.org/docs/databases/installing-database-drivers -FROM docker.io/apache/superset:3.0.1 +FROM docker.io/apache/superset:4.0.0 USER root @@ -18,11 +18,11 @@ RUN apt-get update \ pkg-config RUN --mount=type=cache,target=/root/.cache/pip,sharing=shared pip install \ - clickhouse-driver==0.2.6 \ - mysqlclient==2.2.0 \ - clickhouse-connect==0.6.20 \ + clickhouse-driver==0.2.7 \ + mysqlclient==2.2.4 \ + clickhouse-connect==0.7.8 \ clickhouse-sqlalchemy==0.2.4 \ - authlib==1.2.1 + authlib==1.3.0 USER superset diff --git a/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py b/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py index f88fab7..65354c0 100644 --- a/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py +++ b/tutorcairn/templates/cairn/build/cairn-superset/cairn/bootstrap.py @@ -88,7 +88,8 @@ def check_permission(permission_view) -> bool: return False # Create or update role with the same name as the user - security_manager.set_role(role_name, check_permission) + pvms = security_manager._get_all_pvms() + security_manager.set_role(role_name, check_permission, pvms) def create_clickhouse_user(clickhouse_username): diff --git a/tutorcairn/templates/cairn/build/cairn-superset/cairn/ctl.py b/tutorcairn/templates/cairn/build/cairn-superset/cairn/ctl.py index ce8bd0b..4f5bf48 100644 --- a/tutorcairn/templates/cairn/build/cairn-superset/cairn/ctl.py +++ b/tutorcairn/templates/cairn/build/cairn-superset/cairn/ctl.py @@ -13,7 +13,7 @@ from superset.models.core import Database from superset.models.slice import Slice from superset.extensions import db, security_manager -import superset.dashboards.commands.importers.v0 as importers +import superset.commands.dashboard.importers.v0 as importers from werkzeug.security import generate_password_hash # Our convenient library