-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: automatically format sql files
- Loading branch information
Showing
43 changed files
with
607 additions
and
701 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[tool.sqlfmt] | ||
dialect="clickhouse" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ black | |
pyinstaller | ||
pylint | ||
twine | ||
shandy-sqlfmt[jinjafmt]==0.21.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
tutoraspects/templates/openedx-assets/queries/at_risk_problem_results.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
select results.* | ||
from {{ DBT_PROFILE_TARGET_DATABASE }}.int_problem_results results | ||
join ( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
using (org, course_key, actor_id) | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners using (org, course_key, actor_id) |
16 changes: 8 additions & 8 deletions
16
tutoraspects/templates/openedx-assets/queries/common_filters.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{% raw -%} | ||
{% if filter_values('org') != [] %} | ||
and org in {{ filter_values('org') | where_in }} | ||
{% if filter_values("org") != [] %} | ||
and org in {{ filter_values("org") | where_in }} | ||
{% endif %} | ||
|
||
{% if filter_values('course_name') != [] %} | ||
and course_key in ( | ||
select course_key | ||
from {% endraw -%}{{ ASPECTS_EVENT_SINK_DATABASE }}.course_names{%- raw %} | ||
where course_name in {{ filter_values('course_name') | where_in }} | ||
) | ||
{% if filter_values("course_name") != [] %} | ||
and course_key in ( | ||
select course_key | ||
from {% endraw -%} {{ ASPECTS_EVENT_SINK_DATABASE }}.course_names{%- raw %} | ||
where course_name in {{ filter_values("course_name") | where_in }} | ||
) | ||
{% endif %} | ||
{%- endraw %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 5 additions & 7 deletions
12
tutoraspects/templates/openedx-assets/queries/fact_at_risk_navigation_completion.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
select | ||
fnc.* | ||
from | ||
{{ DBT_PROFILE_TARGET_DATABASE }}.fact_navigation_completion fnc | ||
join ( | ||
select fnc.* | ||
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_navigation_completion fnc | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
using (org, course_key, actor_id) | ||
) as at_risk_learners using (org, course_key, actor_id) |
9 changes: 4 additions & 5 deletions
9
tutoraspects/templates/openedx-assets/queries/fact_at_risk_pageview_engagement.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
select | ||
fact_pageview_engagement.* | ||
select fact_pageview_engagement.* | ||
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_pageview_engagement | ||
join ( | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
using (org, course_key, actor_id) | ||
) as at_risk_learners using (org, course_key, actor_id) |
17 changes: 9 additions & 8 deletions
17
tutoraspects/templates/openedx-assets/queries/fact_at_risk_problem_engagement.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
{% include 'openedx-assets/queries/fact_problem_engagement.sql' %} | ||
join ( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
on ( | ||
pe.org = at_risk_learners.org | ||
and pe.course_key = at_risk_learners.course_key | ||
and pe.actor_id = at_risk_learners.actor_id | ||
) | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
on ( | ||
pe.org = at_risk_learners.org | ||
and pe.course_key = at_risk_learners.course_key | ||
and pe.actor_id = at_risk_learners.actor_id | ||
) |
11 changes: 5 additions & 6 deletions
11
tutoraspects/templates/openedx-assets/queries/fact_at_risk_video_engagement.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
select | ||
fact_video_engagement.* | ||
select fact_video_engagement.* | ||
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_video_engagement | ||
join ( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
using (org, course_key, actor_id) | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners using (org, course_key, actor_id) |
10 changes: 4 additions & 6 deletions
10
tutoraspects/templates/openedx-assets/queries/fact_at_risk_video_plays.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
with video_plays as ( | ||
{% include 'openedx-assets/queries/fact_video_plays.sql' %} | ||
) | ||
with video_plays as ({% include 'openedx-assets/queries/fact_video_plays.sql' %}) | ||
|
||
select video_plays.* | ||
from video_plays | ||
join ( | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
using (org, course_key, actor_id) | ||
) as at_risk_learners using (org, course_key, actor_id) |
10 changes: 4 additions & 6 deletions
10
tutoraspects/templates/openedx-assets/queries/fact_at_risk_video_watches.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
with watches as ( | ||
{% include 'openedx-assets/queries/fact_video_watches.sql' %} | ||
) | ||
with watches as ({% include 'openedx-assets/queries/fact_video_watches.sql' %}) | ||
|
||
select watches.* | ||
from watches | ||
join ( | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
using (org, course_key, actor_id) | ||
) as at_risk_learners using (org, course_key, actor_id) |
10 changes: 4 additions & 6 deletions
10
tutoraspects/templates/openedx-assets/queries/fact_at_risk_watched_video_segments.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
with watches as ( | ||
{% include 'openedx-assets/queries/fact_watched_video_segments.sql' %} | ||
) | ||
with watches as ({% include 'openedx-assets/queries/fact_watched_video_segments.sql' %}) | ||
|
||
select watches.* | ||
from watches | ||
join ( | ||
join | ||
( | ||
{% include 'openedx-assets/queries/at_risk_learner_filter.sql' %} | ||
) as at_risk_learners | ||
using (org, course_key, actor_id) | ||
) as at_risk_learners using (org, course_key, actor_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.