From d8e5e0d5b9c51aa25b8e653d3f50a00a84d9ac4c Mon Sep 17 00:00:00 2001 From: ted kaemming <65315+tkaemming@users.noreply.github.com> Date: Fri, 2 Aug 2024 22:59:42 -0500 Subject: [PATCH] `get_alter_table_statements` -> `get_alter_create_statements` Co-authored-by: James Greenhill --- .../0074_add_custom_and_features_property_groups.py | 4 ++-- posthog/clickhouse/property_groups.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/posthog/clickhouse/migrations/0074_add_custom_and_features_property_groups.py b/posthog/clickhouse/migrations/0074_add_custom_and_features_property_groups.py index 01e75482e7de9..73f7958e7a868 100644 --- a/posthog/clickhouse/migrations/0074_add_custom_and_features_property_groups.py +++ b/posthog/clickhouse/migrations/0074_add_custom_and_features_property_groups.py @@ -4,7 +4,7 @@ operations = [ run_sql_with_exceptions(statement) for statement in [ - *sharded_events_property_groups.get_alter_table_statements("custom"), - *sharded_events_property_groups.get_alter_table_statements("feature_flags"), + *sharded_events_property_groups.get_alter_create_statements("custom"), + *sharded_events_property_groups.get_alter_create_statements("feature_flags"), ] ] diff --git a/posthog/clickhouse/property_groups.py b/posthog/clickhouse/property_groups.py index 89af85e125741..b9afb472819c9 100644 --- a/posthog/clickhouse/property_groups.py +++ b/posthog/clickhouse/property_groups.py @@ -24,7 +24,7 @@ def register(self, name: str, definition: PropertyGroupDefinition) -> None: def __get_map_expression(self, definition: PropertyGroupDefinition) -> str: return f"mapSort(mapFilter((key, _) -> {definition.filter_expression}, CAST(JSONExtractKeysAndValues({self.__source_column}, 'String'), 'Map(String, String)')))" - def get_alter_table_statements(self, name: str) -> Iterable[str]: + def get_alter_create_statements(self, name: str) -> Iterable[str]: column_name = f"{self.__source_column}_group_{name}" definition = self.__groups[name] return [