Skip to content

Commit 8edac79

Browse files
committed
Fix: use identity check for metric model resolution in all three fallback loops
1 parent 12a35b2 commit 8edac79

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sidemantic/sql/generator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,7 @@ def resolve_ratio_ref(ref: str) -> str:
22002200
metric_model_name = model_context
22012201
if not metric_model_name:
22022202
for m_name, m in self.graph.models.items():
2203-
if metric in m.metrics:
2203+
if any(metric is mm for mm in m.metrics):
22042204
metric_model_name = m_name
22052205
break
22062206

@@ -2338,7 +2338,7 @@ def _generate_retention_query(
23382338
# Find the model that owns this metric if not already found
23392339
if not model:
23402340
for m_name, m in self.graph.models.items():
2341-
if metric in m.metrics:
2341+
if any(metric is mm for mm in m.metrics):
23422342
model = m
23432343
break
23442344
if not model:
@@ -2545,7 +2545,7 @@ def _generate_conversion_query(
25452545
if not model:
25462546
# First, try to find which model has this conversion metric defined
25472547
for m_name, m in self.graph.models.items():
2548-
if metric in m.metrics:
2548+
if any(metric is mm for mm in m.metrics):
25492549
model = m
25502550
break
25512551

0 commit comments

Comments
 (0)