diff --git a/ee/clickhouse/materialized_columns/columns.py b/ee/clickhouse/materialized_columns/columns.py index 5b95ed4af58..778869162cc 100644 --- a/ee/clickhouse/materialized_columns/columns.py +++ b/ee/clickhouse/materialized_columns/columns.py @@ -117,17 +117,6 @@ class MaterializedColumnDetails: raise ValueError(f"unexpected comment format: {comment!r}") -def get_materialized_columns( - table: TablesWithMaterializedColumns, - exclude_disabled_columns: bool = False, -) -> dict[tuple[PropertyName, TableColumn], ColumnName]: - return { - (column.details.property_name, column.details.table_column): column.name - for column in MaterializedColumn.get_all(table) - if not (exclude_disabled_columns and column.details.is_disabled) - } - - def get_on_cluster_clause_for_table(table: TableWithProperties) -> str: return f"ON CLUSTER '{CLICKHOUSE_CLUSTER}'" if table == "events" else "" diff --git a/ee/clickhouse/materialized_columns/test/test_columns.py b/ee/clickhouse/materialized_columns/test/test_columns.py index c8250a66013..e06d9f54e90 100644 --- a/ee/clickhouse/materialized_columns/test/test_columns.py +++ b/ee/clickhouse/materialized_columns/test/test_columns.py @@ -10,13 +10,13 @@ from ee.clickhouse.materialized_columns.columns import ( MaterializedColumnDetails, backfill_materialized_columns, drop_column, - get_materialized_columns, materialize, update_column_is_disabled, ) from posthog.clickhouse.materialized_columns import ( TablesWithMaterializedColumns, get_enabled_materialized_columns, + get_materialized_columns, ) from posthog.client import sync_execute from posthog.conftest import create_clickhouse_tables diff --git a/posthog/clickhouse/materialized_columns.py b/posthog/clickhouse/materialized_columns.py index 2e2d8efffb2..cfd6b930846 100644 --- a/posthog/clickhouse/materialized_columns.py +++ b/posthog/clickhouse/materialized_columns.py @@ -10,7 +10,17 @@ ColumnName = str TablesWithMaterializedColumns = TableWithProperties if EE_AVAILABLE: - from ee.clickhouse.materialized_columns.columns import get_materialized_columns + from ee.clickhouse.materialized_columns.columns import MaterializedColumn + + def get_materialized_columns( + table: TablesWithMaterializedColumns, + exclude_disabled_columns: bool = False, + ) -> dict[tuple[PropertyName, TableColumn], ColumnName]: + return { + (column.details.property_name, column.details.table_column): column.name + for column in MaterializedColumn.get_all(table) + if not (exclude_disabled_columns and column.details.is_disabled) + } else: def get_materialized_columns(