diff --git a/metricflow/dag/id_generation.py b/metricflow/dag/id_generation.py index e08fca06de..1fd5e03581 100644 --- a/metricflow/dag/id_generation.py +++ b/metricflow/dag/id_generation.py @@ -35,6 +35,7 @@ SQL_EXPR_IS_NULL_PREFIX = "isn" SQL_EXPR_CAST_TO_TIMESTAMP_PREFIX = "ctt" SQL_EXPR_DATE_TRUNC = "dt" +SQL_EXPR_SUBTRACT_TIME_INTERVAL_PREFIX = "sti" SQL_EXPR_EXTRACT = "ex" SQL_EXPR_RATIO_COMPUTATION = "rc" SQL_EXPR_BETWEEN_PREFIX = "betw" diff --git a/metricflow/sql/sql_exprs.py b/metricflow/sql/sql_exprs.py index bb6c13b851..2206691e7c 100644 --- a/metricflow/sql/sql_exprs.py +++ b/metricflow/sql/sql_exprs.py @@ -16,6 +16,7 @@ from metricflow.dag.id_generation import ( SQL_EXPR_BETWEEN_PREFIX, + SQL_EXPR_CAST_TO_TIMESTAMP_PREFIX, SQL_EXPR_COLUMN_REFERENCE_ID_PREFIX, SQL_EXPR_COMPARISON_ID_PREFIX, SQL_EXPR_DATE_TRUNC, @@ -29,6 +30,7 @@ SQL_EXPR_RATIO_COMPUTATION, SQL_EXPR_STRING_ID_PREFIX, SQL_EXPR_STRING_LITERAL_PREFIX, + SQL_EXPR_SUBTRACT_TIME_INTERVAL_PREFIX, SQL_EXPR_WINDOW_FUNCTION_ID_PREFIX, ) from metricflow.dag.mf_dag import DagNode, DisplayedProperty, NodeId @@ -1265,7 +1267,7 @@ def __init__( # noqa: D @classmethod def id_prefix(cls) -> str: # noqa: D - return SQL_EXPR_IS_NULL_PREFIX + return SQL_EXPR_SUBTRACT_TIME_INTERVAL_PREFIX @property def requires_parenthesis(self) -> bool: # noqa: D @@ -1321,7 +1323,7 @@ def __init__(self, arg: SqlExpressionNode) -> None: # noqa: D @classmethod def id_prefix(cls) -> str: # noqa: D - return SQL_EXPR_IS_NULL_PREFIX + return SQL_EXPR_CAST_TO_TIMESTAMP_PREFIX @property def requires_parenthesis(self) -> bool: # noqa: D