From 27db09a8d6741c0978c98c6ecff8460177ff3842 Mon Sep 17 00:00:00 2001 From: Alison Spencer Date: Mon, 5 Aug 2024 15:50:47 -0700 Subject: [PATCH] When retrieving point_ids within MetricsReader, compare the lengths of the sets of point_map keys and desired aliases, rather than the lengths of the raw lists. This allows a point_id to be retrieved when the desired property is associate with more than one key (eg, ReturnTemperature and ControlTemperature). --- atlas/metrics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atlas/metrics.py b/atlas/metrics.py index 05b5e89..6a2a5dc 100644 --- a/atlas/metrics.py +++ b/atlas/metrics.py @@ -133,7 +133,7 @@ def _get_point_ids(self, facility, agent_id: str, aliases: List[str]) -> Dict[st except Exception as e: raise Exception(f"Error listing points for facility {facility.display_name}: {e}") - if len(point_map) != len(aliases): + if len(set(point_map.keys())) != len(set(aliases)): not_found = set(aliases) - set(point_map.keys()) raise Exception(f"Points {not_found} not found for facility {facility.short_name}")