From 90903c3270469ec5908573f6a5febd6a636c56d6 Mon Sep 17 00:00:00 2001 From: henrrypg Date: Fri, 27 Oct 2023 14:54:51 -0500 Subject: [PATCH] fix: address suggestions --- README.rst | 4 ++-- .../apps/superset/pythonpath/create_assets.py | 17 +++++++++-------- .../assets/datasets/dim_course_problems.yaml | 2 +- .../assets/datasets/dim_course_videos.yaml | 2 +- .../assets/datasets/fact_course_grades.yaml | 2 +- .../assets/datasets/fact_enrollments.yaml | 2 +- .../datasets/fact_enrollments_by_day.yaml | 2 +- .../datasets/fact_forum_interactions.yaml | 2 +- .../fact_learner_problem_course_summary.yaml | 2 +- .../datasets/fact_learner_problem_summary.yaml | 2 +- .../assets/datasets/fact_problem_grades.yaml | 2 +- .../assets/datasets/fact_problem_responses.yaml | 2 +- .../assets/datasets/fact_transcript_usage.yaml | 2 +- .../assets/datasets/fact_video_plays.yaml | 2 +- .../datasets/fact_watched_video_segments.yaml | 2 +- .../assets/datasets/hints_per_success.yaml | 2 +- .../assets/datasets/posts_per_user.yaml | 2 +- .../queries/fact_forum_interactions.sql | 4 ---- .../openedx-assets/queries/common_filters.sql | 0 .../queries/dim_course_problems.sql | 0 .../queries/dim_course_videos.sql | 0 .../queries/fact_course_grades.sql | 2 +- .../openedx-assets/queries/fact_enrollments.sql | 2 +- .../queries/fact_enrollments_by_day.sql | 2 +- .../queries/fact_forum_interactions.sql | 4 ++++ .../fact_learner_problem_course_summary.sql | 4 ++-- .../queries/fact_learner_problem_summary.sql | 4 ++-- .../queries/fact_problem_grades.sql | 2 +- .../queries/fact_problem_responses.sql | 2 +- .../queries/fact_transcript_usage.sql | 2 +- .../openedx-assets/queries/fact_video_plays.sql | 2 +- .../queries/fact_watched_video_segments.sql | 2 +- .../queries/hints_per_success.sql | 2 +- .../queries/int_problem_responses.sql | 2 +- .../openedx-assets/queries/posts_per_user.sql | 0 35 files changed, 44 insertions(+), 43 deletions(-) delete mode 100644 tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_forum_interactions.sql rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/common_filters.sql (100%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/dim_course_problems.sql (100%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/dim_course_videos.sql (100%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_course_grades.sql (92%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_enrollments.sql (73%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_enrollments_by_day.sql (94%) create mode 100644 tutoraspects/templates/openedx-assets/queries/fact_forum_interactions.sql rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_learner_problem_course_summary.sql (94%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_learner_problem_summary.sql (94%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_problem_grades.sql (92%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_problem_responses.sql (86%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_transcript_usage.sql (82%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_video_plays.sql (82%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/fact_watched_video_segments.sql (96%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/hints_per_success.sql (78%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/int_problem_responses.sql (78%) rename tutoraspects/templates/{aspects/build/aspects-superset => }/openedx-assets/queries/posts_per_user.sql (100%) diff --git a/README.rst b/README.rst index 14102ad90..663e1ca4f 100644 --- a/README.rst +++ b/README.rst @@ -149,7 +149,7 @@ To contribute assets to Aspects: their actual SQL. If you haven't changed the SQL of these queries (stored in `tutoraspects/templates/openedx-assets/queries` you can just revert that change back to their `include` values such as: - `sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments_by_day.sql' %}"` + `sql: "{% include 'openedx-assets/queries/fact_enrollments_by_day.sql' %}"` #. The script will also warn about missing `_roles` in dashboards. Superset does not export these, so you will need to manually add this key with the roles that are necessary to view the dashboard. See the existing dashboards for how this is done. @@ -172,7 +172,7 @@ To make it easier for developers to manage virtual datasets, there is an extra s .. code-block:: yaml - sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/query.sql' %}" + sql: "{% include 'openedx-assets/queries/query.sql' %}" However, please keep in mind that the assets declaration is itself a jinja template. That means that any jinja used in the dataset definition should be escaped. There are examples of how to handle this in the existing queries, such as `dim_courses.sql`_. diff --git a/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py b/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py index 5a4560cdf..eba47b337 100644 --- a/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py +++ b/tutoraspects/templates/aspects/apps/superset/pythonpath/create_assets.py @@ -75,14 +75,15 @@ def create_assets(): continue # Process the asset directly - if FILE_NAME_ATTRIBUTE in asset: - file_name = asset.pop(FILE_NAME_ATTRIBUTE) - - # Find the right folder to create the asset in - for asset_name, folder in ASSET_FOLDER_MAPPING.items(): - if asset_name in asset: - write_asset_to_file(asset, asset_name, folder, file_name, roles) - break + if FILE_NAME_ATTRIBUTE not in asset: + raise Exception(f"Asset {asset} has no {FILE_NAME_ATTRIBUTE}") + file_name = asset.pop(FILE_NAME_ATTRIBUTE) + + # Find the right folder to create the asset in + for asset_name, folder in ASSET_FOLDER_MAPPING.items(): + if asset_name in asset: + write_asset_to_file(asset, asset_name, folder, file_name, roles) + break with open(ASSETS_FILE_PATH, "r") as file: extra_assets = yaml.safe_load(file) diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_problems.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_problems.yaml index 0699f41c5..65fdb9ae3 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_problems.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_problems.yaml @@ -106,7 +106,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/dim_course_problems.sql' %}" +sql: "{% include 'openedx-assets/queries/dim_course_problems.sql' %}" table_name: dim_course_problems template_params: {} uuid: 008e2907-fc6b-45ef-bf85-73a04c5791ff diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_videos.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_videos.yaml index 8e94eeb1e..1d330b459 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_videos.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/dim_course_videos.yaml @@ -106,7 +106,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/dim_course_videos.sql' %}" +sql: "{% include 'openedx-assets/queries/dim_course_videos.sql' %}" table_name: dim_course_videos template_params: {} uuid: 417b2035-8fa1-4c60-a405-4b1947c3c966 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_course_grades.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_course_grades.yaml index 11a7c1f35..628f8a735 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_course_grades.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_course_grades.yaml @@ -142,7 +142,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_course_grades.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_course_grades.sql' %}" table_name: fact_course_grades template_params: {} uuid: d777bd95-2110-46db-a1c4-8358be81a85a diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments.yaml index 1b8547bad..119bab1f7 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments.yaml @@ -118,7 +118,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_enrollments.sql' %}" table_name: fact_enrollments template_params: {} uuid: a234545d-08ff-480d-8361-961c3d15f14f diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments_by_day.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments_by_day.yaml index 2ac1a2b3f..a339fa8ff 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments_by_day.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_enrollments_by_day.yaml @@ -118,7 +118,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments_by_day.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_enrollments_by_day.sql' %}" table_name: fact_enrollments_by_day template_params: {} uuid: 352311fe-12f0-470c-8b8c-d4f6a3936b3d diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_forum_interactions.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_forum_interactions.yaml index cf69a749e..0d58f5347 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_forum_interactions.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_forum_interactions.yaml @@ -130,7 +130,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_forum_interactions.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_forum_interactions.sql' %}" table_name: fact_forum_interactions template_params: {} uuid: 39d1e786-c0c8-4c56-81c8-56fb0df88001 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_course_summary.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_course_summary.yaml index 1feb44e57..3594081c1 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_course_summary.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_course_summary.yaml @@ -154,7 +154,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_course_summary.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_learner_problem_course_summary.sql' %}" table_name: fact_learner_problem_course_summary template_params: null uuid: 981f30d9-b2f0-4a0b-9e95-0ee0e06db806 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_summary.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_summary.yaml index 21c93b747..e0ae49e4b 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_summary.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_learner_problem_summary.yaml @@ -154,7 +154,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_summary.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_learner_problem_summary.sql' %}" table_name: fact_learner_problem_summary template_params: null uuid: 9362354c-1541-43c2-b769-da9818236298 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_grades.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_grades.yaml index aee209999..a541bd125 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_grades.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_grades.yaml @@ -142,7 +142,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_problem_grades.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_problem_grades.sql' %}" table_name: fact_problem_grades template_params: {} uuid: b31154e0-afed-4445-b90d-a501d555784e diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_responses.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_responses.yaml index da66d05bc..31f54804b 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_responses.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_responses.yaml @@ -142,7 +142,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_problem_responses.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_problem_responses.sql' %}" table_name: fact_problem_responses template_params: null uuid: 511dd5f1-3925-4e9e-ad8a-a227b5680047 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_transcript_usage.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_transcript_usage.yaml index 756a1ffcd..83ab74871 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_transcript_usage.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_transcript_usage.yaml @@ -119,7 +119,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_transcript_usage.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_transcript_usage.sql' %}" table_name: fact_transcript_usage template_params: {} uuid: a96a4b13-a429-442d-83ca-5d6f94010909 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml index 5a3f7f225..056c9ba6f 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_video_plays.yaml @@ -119,7 +119,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_video_plays.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_video_plays.sql' %}" table_name: fact_video_plays template_params: {} uuid: 6ec360a5-e247-42e7-b301-fa8275fc93f9 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_watched_video_segments.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_watched_video_segments.yaml index f7f15bdcd..8801d6c0b 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_watched_video_segments.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/fact_watched_video_segments.yaml @@ -149,7 +149,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_watched_video_segments.sql' %}" +sql: "{% include 'openedx-assets/queries/fact_watched_video_segments.sql' %}" table_name: fact_watched_video_segments template_params: null uuid: c2c391b3-3403-4f05-bc0b-3de53bd366ec diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/hints_per_success.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/hints_per_success.yaml index c30d94b45..2eb17b200 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/hints_per_success.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/hints_per_success.yaml @@ -118,7 +118,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/hints_per_success.sql' %}" +sql: "{% include 'openedx-assets/queries/hints_per_success.sql' %}" table_name: hints_per_success template_params: null uuid: a5db584d-c8dd-4acc-889e-074288c38433 diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/posts_per_user.yaml b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/posts_per_user.yaml index 24e598085..ea0065896 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/posts_per_user.yaml +++ b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/assets/datasets/posts_per_user.yaml @@ -94,7 +94,7 @@ normalize_columns: true offset: 0 params: null schema: main -sql: "{% include 'aspects/build/aspects-superset/openedx-assets/queries/posts_per_user.sql' %}" +sql: "{% include 'openedx-assets/queries/posts_per_user.sql' %}" table_name: posts_per_user template_params: {} uuid: a2823d2e-54c4-4378-98c2-817f000c14ab diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_forum_interactions.sql b/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_forum_interactions.sql deleted file mode 100644 index 9553d712a..000000000 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_forum_interactions.sql +++ /dev/null @@ -1,4 +0,0 @@ -select * -from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_forum_interactions -where 1=1 - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql b/tutoraspects/templates/openedx-assets/queries/common_filters.sql similarity index 100% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql rename to tutoraspects/templates/openedx-assets/queries/common_filters.sql diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/dim_course_problems.sql b/tutoraspects/templates/openedx-assets/queries/dim_course_problems.sql similarity index 100% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/dim_course_problems.sql rename to tutoraspects/templates/openedx-assets/queries/dim_course_problems.sql diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/dim_course_videos.sql b/tutoraspects/templates/openedx-assets/queries/dim_course_videos.sql similarity index 100% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/dim_course_videos.sql rename to tutoraspects/templates/openedx-assets/queries/dim_course_videos.sql diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_course_grades.sql b/tutoraspects/templates/openedx-assets/queries/fact_course_grades.sql similarity index 92% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_course_grades.sql rename to tutoraspects/templates/openedx-assets/queries/fact_course_grades.sql index b47a74b15..92ae63466 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_course_grades.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_course_grades.sql @@ -9,7 +9,7 @@ with grades as ( and 0=1 {% endif %} {% endraw %} - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ), most_recent_grades as ( select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments.sql b/tutoraspects/templates/openedx-assets/queries/fact_enrollments.sql similarity index 73% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments.sql rename to tutoraspects/templates/openedx-assets/queries/fact_enrollments.sql index 26e3de151..2af0fb504 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_enrollments.sql @@ -3,7 +3,7 @@ select * from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_enrollments where 1=1 - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ) select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments_by_day.sql b/tutoraspects/templates/openedx-assets/queries/fact_enrollments_by_day.sql similarity index 94% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments_by_day.sql rename to tutoraspects/templates/openedx-assets/queries/fact_enrollments_by_day.sql index e746d6012..da5b5a176 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments_by_day.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_enrollments_by_day.sql @@ -1,5 +1,5 @@ with enrollments as ( - {% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_enrollments.sql' %} + {% include 'openedx-assets/queries/fact_enrollments.sql' %} ), enrollments_ranked as ( select emission_time, diff --git a/tutoraspects/templates/openedx-assets/queries/fact_forum_interactions.sql b/tutoraspects/templates/openedx-assets/queries/fact_forum_interactions.sql new file mode 100644 index 000000000..1126c18bc --- /dev/null +++ b/tutoraspects/templates/openedx-assets/queries/fact_forum_interactions.sql @@ -0,0 +1,4 @@ +select * +from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_forum_interactions +where 1=1 + {% include 'openedx-assets/queries/common_filters.sql' %} diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_course_summary.sql b/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_course_summary.sql similarity index 94% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_course_summary.sql rename to tutoraspects/templates/openedx-assets/queries/fact_learner_problem_course_summary.sql index a692951cd..bf4468a0c 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_course_summary.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_course_summary.sql @@ -1,5 +1,5 @@ WITH problem_responses AS ( - {% include 'aspects/build/aspects-superset/openedx-assets/queries/int_problem_responses.sql' %} + {% include 'openedx-assets/queries/int_problem_responses.sql' %} ), outcomes AS ( SELECT emission_time, @@ -116,7 +116,7 @@ WITH problem_responses AS ( and emission_time < '{{ to_dttm }}' {% endif %} {% endraw %} - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ) SELECT diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_summary.sql b/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql similarity index 94% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_summary.sql rename to tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql index 58d6d9b35..e55e91418 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_summary.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql @@ -1,5 +1,5 @@ WITH problem_responses AS ( - {% include 'aspects/build/aspects-superset/openedx-assets/queries/int_problem_responses.sql' %} + {% include 'openedx-assets/queries/int_problem_responses.sql' %} ), outcomes AS ( SELECT emission_time, @@ -100,7 +100,7 @@ WITH problem_responses AS ( FROM {{ DBT_PROFILE_TARGET_DATABASE }}.int_problem_hints WHERE 1=1 - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ) SELECT diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_problem_grades.sql b/tutoraspects/templates/openedx-assets/queries/fact_problem_grades.sql similarity index 92% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_problem_grades.sql rename to tutoraspects/templates/openedx-assets/queries/fact_problem_grades.sql index c64222785..e401148dd 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_problem_grades.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_problem_grades.sql @@ -12,7 +12,7 @@ with grades as ( {% endif %} {% endraw %} - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ), most_recent_grades as ( select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_problem_responses.sql b/tutoraspects/templates/openedx-assets/queries/fact_problem_responses.sql similarity index 86% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_problem_responses.sql rename to tutoraspects/templates/openedx-assets/queries/fact_problem_responses.sql index 7a5896070..94d12be8a 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_problem_responses.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_problem_responses.sql @@ -1,5 +1,5 @@ with problem_responses as ( - {% include 'aspects/build/aspects-superset/openedx-assets/queries/int_problem_responses.sql' %} + {% include 'openedx-assets/queries/int_problem_responses.sql' %} ) select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_transcript_usage.sql b/tutoraspects/templates/openedx-assets/queries/fact_transcript_usage.sql similarity index 82% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_transcript_usage.sql rename to tutoraspects/templates/openedx-assets/queries/fact_transcript_usage.sql index c4018238d..bba2968c7 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_transcript_usage.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_transcript_usage.sql @@ -9,7 +9,7 @@ where 0=1 {% endif %} {% endraw %} - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ) select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_video_plays.sql b/tutoraspects/templates/openedx-assets/queries/fact_video_plays.sql similarity index 82% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_video_plays.sql rename to tutoraspects/templates/openedx-assets/queries/fact_video_plays.sql index 59b113040..4bdc18c9b 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_video_plays.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_video_plays.sql @@ -9,7 +9,7 @@ where 1=0 {% endif %} {% endraw %} - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ) select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_watched_video_segments.sql b/tutoraspects/templates/openedx-assets/queries/fact_watched_video_segments.sql similarity index 96% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_watched_video_segments.sql rename to tutoraspects/templates/openedx-assets/queries/fact_watched_video_segments.sql index d83bb038a..bb64b1301 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/fact_watched_video_segments.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_watched_video_segments.sql @@ -9,7 +9,7 @@ with video_events as ( video_position from {{ ASPECTS_XAPI_DATABASE }}.{{ ASPECTS_VIDEO_PLAYBACK_EVENTS_TABLE }} where 1=1 - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ), starts as ( select * from video_events diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/hints_per_success.sql b/tutoraspects/templates/openedx-assets/queries/hints_per_success.sql similarity index 78% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/hints_per_success.sql rename to tutoraspects/templates/openedx-assets/queries/hints_per_success.sql index 4348989d9..65d7253ee 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/hints_per_success.sql +++ b/tutoraspects/templates/openedx-assets/queries/hints_per_success.sql @@ -1,5 +1,5 @@ with summary as ( - {% include 'aspects/build/aspects-superset/openedx-assets/queries/fact_learner_problem_summary.sql' %} + {% include 'openedx-assets/queries/fact_learner_problem_summary.sql' %} ) select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/int_problem_responses.sql b/tutoraspects/templates/openedx-assets/queries/int_problem_responses.sql similarity index 78% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/int_problem_responses.sql rename to tutoraspects/templates/openedx-assets/queries/int_problem_responses.sql index 550f635a0..57b4142f0 100644 --- a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/int_problem_responses.sql +++ b/tutoraspects/templates/openedx-assets/queries/int_problem_responses.sql @@ -2,7 +2,7 @@ with problem_responses as ( select * from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_problem_responses where 1=1 - {% include 'aspects/build/aspects-superset/openedx-assets/queries/common_filters.sql' %} + {% include 'openedx-assets/queries/common_filters.sql' %} ) select diff --git a/tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/posts_per_user.sql b/tutoraspects/templates/openedx-assets/queries/posts_per_user.sql similarity index 100% rename from tutoraspects/templates/aspects/build/aspects-superset/openedx-assets/queries/posts_per_user.sql rename to tutoraspects/templates/openedx-assets/queries/posts_per_user.sql