From 4afdbc83b874281ddc09d739e37cdb9c82d0c2cb Mon Sep 17 00:00:00 2001 From: Brian Mesick Date: Thu, 22 Aug 2024 13:52:50 -0400 Subject: [PATCH 1/2] feat: Upgrade ClickHouse to 24.8 --- tutoraspects/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index b8733da60..094569eb2 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -34,7 +34,7 @@ ("RUN_RALPH", True), ("RUN_SUPERSET", True), ("DOCKER_IMAGE_ASPECTS", "edunext/aspects:{{ ASPECTS_VERSION }}"), - ("DOCKER_IMAGE_CLICKHOUSE", "clickhouse/clickhouse-server:24.3"), + ("DOCKER_IMAGE_CLICKHOUSE", "clickhouse/clickhouse-server:24.8"), ("DOCKER_IMAGE_RALPH", "fundocker/ralph:4.1.0"), ("DOCKER_IMAGE_SUPERSET", "edunext/aspects-superset:{{ ASPECTS_VERSION }}"), ("DOCKER_IMAGE_VECTOR", "timberio/vector:0.30.0-alpine"), From 1f64b89144030b8e0697b1e1ac80b3c60dfacd63 Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Fri, 23 Aug 2024 13:49:36 -0500 Subject: [PATCH 2/2] fix: drop dependent dictionaries before dropping tables --- .../versions/0023_extend_display_names.py | 17 ++++++++--------- .../0037_remove_most_recent_course_blocks.py | 7 +++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0023_extend_display_names.py b/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0023_extend_display_names.py index 6fa6d783f..67232fd80 100644 --- a/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0023_extend_display_names.py +++ b/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0023_extend_display_names.py @@ -17,32 +17,31 @@ def drop_objects(): + # We include these drop statements here because "CREATE OR REPLACE DICTIONARY" + # currently throws a file rename error and you can't drop a dictionary with a + # table referring to it. op.execute( f""" - DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks + DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names {on_cluster} """ ) - op.execute( f""" - DROP VIEW IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks_mv + DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names_dict {on_cluster} """ ) - - # We include these drop statements here because "CREATE OR REPLACE DICTIONARY" - # currently throws a file rename error and you can't drop a dictionary with a - # table referring to it. op.execute( f""" - DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names + DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks {on_cluster} """ ) + op.execute( f""" - DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names_dict + DROP VIEW IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks_mv {on_cluster} """ ) diff --git a/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0037_remove_most_recent_course_blocks.py b/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0037_remove_most_recent_course_blocks.py index f1996e2cc..a107a41e3 100644 --- a/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0037_remove_most_recent_course_blocks.py +++ b/tutoraspects/templates/aspects/apps/aspects/migrations/alembic/versions/0037_remove_most_recent_course_blocks.py @@ -30,6 +30,13 @@ def drop_objects(): """ ) + op.execute( + f""" + DROP DICTIONARY IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.course_block_names + {on_cluster} + """ + ) + op.execute( f""" DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.most_recent_course_blocks