Skip to content

Commit

Permalink
feat: migrate aspects dictionaries to dbt
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Apr 8, 2024
1 parent 768df58 commit bb872d1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tutoraspects/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@
# For now we are pulling this from github, which should allow maximum
# flexibility for forking, running branches, specific versions, etc.
("DBT_REPOSITORY", "https://github.com/openedx/aspects-dbt"),
("DBT_BRANCH", "v3.12.0"),
("DBT_BRANCH", "cag/migrate-dictionaries"),
("DBT_SSH_KEY", ""),
("DBT_STATE_DIR", "/app/aspects/dbt_state/"),
# This is a pip compliant list of Python packages to install to run dbt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ aspects: # this needs to match the profile in your dbt_project.yml file
type: clickhouse
schema: {{ DBT_PROFILE_TARGET_DATABASE }}
host: {{ CLICKHOUSE_HOST }}
port: {{ CLICKHOUSE_INTERNAL_HTTP_PORT }}
port: {{ CLICKHOUSE_INTERNAL_NATIVE_PORT }}
user: {{ CLICKHOUSE_ADMIN_USER }}
password: '{{ CLICKHOUSE_ADMIN_PASSWORD }}'
cluster: {{ CLICKHOUSE_CLUSTER_NAME }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from alembic import op


revision = "0034"
down_revision = "0033"
revision = "0035"
down_revision = "0034"
branch_labels = None
depends_on = None
on_cluster = " ON CLUSTER '{{CLICKHOUSE_CLUSTER_NAME}}' " if "{{CLICKHOUSE_CLUSTER_NAME}}" else ""
Expand All @@ -18,7 +18,7 @@
def upgrade():
op.execute(
f"""
DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.user_pii
DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.user_pii
{on_cluster}
"""
)
Expand All @@ -30,7 +30,7 @@ def upgrade():
)
op.execute(
f"""
DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names
DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names
{on_cluster}
"""
)
Expand All @@ -42,7 +42,7 @@ def upgrade():
)
op.execute(
f"""
DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_names
DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_names
{on_cluster}
"""
)
Expand All @@ -61,7 +61,7 @@ def downgrade():
## Course Names
op.execute(
f"""
DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.user_pii
DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.user_pii
{on_cluster}
"""
)
Expand All @@ -73,7 +73,7 @@ def downgrade():
)
op.execute(
f"""
DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names
DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names
{on_cluster}
"""
)
Expand All @@ -85,7 +85,7 @@ def downgrade():
)
op.execute(
f"""
DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_names
DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_names
{on_cluster}
"""
)
Expand Down

0 comments on commit bb872d1

Please sign in to comment.