mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-21 13:39:22 +01:00
fully move get_materialized_columns into other path
This commit is contained in:
parent
c860620e30
commit
d214624191
@ -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 ""
|
||||
|
||||
|
@ -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
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user