From abce05af894ed4c2d852c69c8cf0f7c82027a74c Mon Sep 17 00:00:00 2001 From: Temisan Iwere Date: Mon, 18 Nov 2024 15:40:40 -0500 Subject: [PATCH] [DISCO-3072] bump accuweather cache key version [load test: (skip)] (#711) --- merino/providers/weather/backends/accuweather/backend.py | 4 ++-- tests/unit/providers/weather/backends/test_accuweather.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/merino/providers/weather/backends/accuweather/backend.py b/merino/providers/weather/backends/accuweather/backend.py index 28d44b9e..c34054c6 100644 --- a/merino/providers/weather/backends/accuweather/backend.py +++ b/merino/providers/weather/backends/accuweather/backend.py @@ -283,9 +283,9 @@ def cache_key_for_accuweather_request( hasher.update(key.encode("utf-8") + value.encode("utf-8")) extra_identifiers = hasher.hexdigest() - return f"{self.__class__.__name__}:v5:{url}:{extra_identifiers}" + return f"{self.__class__.__name__}:v6:{url}:{extra_identifiers}" - return f"{self.__class__.__name__}:v5:{url}" + return f"{self.__class__.__name__}:v6:{url}" @functools.cache def cache_key_template(self, dt: WeatherDataType, language: str) -> str: diff --git a/tests/unit/providers/weather/backends/test_accuweather.py b/tests/unit/providers/weather/backends/test_accuweather.py index fd6b5892..431f140d 100644 --- a/tests/unit/providers/weather/backends/test_accuweather.py +++ b/tests/unit/providers/weather/backends/test_accuweather.py @@ -1992,16 +1992,16 @@ async def test_get_forecast_error(accuweather: AccuweatherBackend, language: str [ ( {"q": "asdfg", "apikey": "filter_me_out"}, - f"AccuweatherBackend:v5:localhost:" + f"AccuweatherBackend:v6:localhost:" f"{hashlib.blake2s('q'.encode('utf-8') + 'asdfg'.encode('utf-8')).hexdigest()}", ), ( {}, - "AccuweatherBackend:v5:localhost", + "AccuweatherBackend:v6:localhost", ), ( {"q": "asdfg"}, - f"AccuweatherBackend:v5:localhost:" + f"AccuweatherBackend:v6:localhost:" f"{hashlib.blake2s('q'.encode('utf-8') + 'asdfg'.encode('utf-8')).hexdigest()}", ), ],