Skip to content

Commit

Permalink
fix: install only dbt requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Apr 15, 2024
1 parent 89acf63 commit e3d5768
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def downgrade():
## Course Block Names
op.execute(
f"""
CREATE TABLE IF NOT EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_RECENT_BLOCKS_TABLE }}
CREATE TABLE IF NOT EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks
{on_cluster}
(
location String NOT NULL,
Expand All @@ -168,9 +168,9 @@ def downgrade():

op.execute(
f"""
create materialized view if not exists {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_RECENT_BLOCKS_MV }}
create materialized view if not exists {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks_mv
{on_cluster}
to {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_RECENT_BLOCKS_TABLE }} as
to {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks as
select
location,
display_name,
Expand All @@ -182,13 +182,13 @@ def downgrade():
course_key,
dump_id,
time_last_dumped
from {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_NODES_TABLE }}
from {{ ASPECTS_EVENT_SINK_DATABASE }}.course_blocks
"""
)

op.execute(
"""
insert into {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_RECENT_BLOCKS_TABLE }} (
insert into {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks (
location, display_name, display_name_with_location, section, subsection, unit, graded, course_key, dump_id, time_last_dumped
)
select
Expand All @@ -202,7 +202,7 @@ def downgrade():
course_key,
dump_id,
time_last_dumped
from {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_NODES_TABLE }};
from {{ ASPECTS_EVENT_SINK_DATABASE }}.course_blocks;
"""
)

Expand All @@ -229,7 +229,7 @@ def downgrade():
course_key,
graded,
display_name_with_location
from {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_RECENT_BLOCKS_TABLE }}
from {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks
final
"
))
Expand Down Expand Up @@ -306,7 +306,7 @@ def downgrade():
profile_image_uploaded_at,
phone_number,
ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY (id, time_last_dumped) DESC) as rn
from {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_USER_PROFILE_TABLE }}
from {{ ASPECTS_EVENT_SINK_DATABASE }}.user_profile
)
select
mrup.user_id as user_id,
Expand All @@ -329,7 +329,7 @@ def downgrade():
bio,
profile_image_uploaded_at,
phone_number
FROM {{ ASPECTS_EVENT_SINK_DATABASE }}.{{ ASPECTS_EVENT_SINK_EXTERNAL_ID_TABLE }} ex
FROM {{ ASPECTS_EVENT_SINK_DATABASE }}.external_id ex
RIGHT OUTER JOIN most_recent_user_profile mrup ON
mrup.user_id = ex.user_id and (
ex.external_id_type = 'xapi' OR
Expand Down
3 changes: 0 additions & 3 deletions tutoraspects/templates/aspects/build/aspects/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# alembic packages
alembic==1.11.1
clickhouse-sqlalchemy==0.1.9
# dbt packages
dbt-core==1.7.3
dbt-clickhouse==1.7.2
git+https://github.com/openedx/[email protected]#egg=xapi-db-load==1.2

0 comments on commit e3d5768

Please sign in to comment.