From 7b376e67dd0b840268ced0e9b9e2b3b0cb313798 Mon Sep 17 00:00:00 2001 From: Tif Tran Date: Sun, 9 Feb 2025 13:59:05 -0800 Subject: [PATCH] feedback changes --- .../suggest/weather/backends/accuweather/pathfinder.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/merino/providers/suggest/weather/backends/accuweather/pathfinder.py b/merino/providers/suggest/weather/backends/accuweather/pathfinder.py index 8ec3a6af..73dc9360 100644 --- a/merino/providers/suggest/weather/backends/accuweather/pathfinder.py +++ b/merino/providers/suggest/weather/backends/accuweather/pathfinder.py @@ -134,7 +134,10 @@ async def explore( country = geolocation.country city = geolocation.city normalized_city = normalize_string(city) - cities = [city, normalized_city] if city != normalized_city else [city] + suffix_remove = remove_locality_suffix(city) + # remove duplicates but maintain order + cities = list(dict.fromkeys([city, normalized_city, suffix_remove])) + for region in compass(weather_context.geolocation): for city in cities: if country and city and (country, region, city) in SKIP_CITIES_MAPPING: