From 7a761274fc9974dd6b7773ef0430590ff11b0246 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Mon, 6 May 2024 14:06:24 -0700 Subject: [PATCH] Undo 'unit' kwarg handling --- neon_api_proxy/services/owm_api.py | 4 ++-- neon_api_proxy/services/wolfram_api.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/neon_api_proxy/services/owm_api.py b/neon_api_proxy/services/owm_api.py index f93980c..f25fa30 100644 --- a/neon_api_proxy/services/owm_api.py +++ b/neon_api_proxy/services/owm_api.py @@ -61,7 +61,7 @@ def handle_query(self, **kwargs) -> dict: lng = kwargs.get("lng", kwargs.get("lon")) api = kwargs.get('api') or "onecall" lang = kwargs.get('lang') or "en" - units = "metric" if kwargs.get("units", kwargs.get("unit")) == "metric" else "imperial" + units = "metric" if kwargs.get("units") == "metric" else "imperial" if not all((lat, lng, units)): return {"status_code": -1, @@ -88,7 +88,7 @@ def _get_api_response(self, lat: str, lng: str, units: str, except AssertionError as e: raise ValueError(e) if api != "onecall": - log_deprecation(f"`{api}` was requested but only `onecall` " + log_deprecation(f"{api} was requested but only `onecall` " f"is supported", "1.0.0") api = "onecall" assert units in ("metric", "imperial", "standard") diff --git a/neon_api_proxy/services/wolfram_api.py b/neon_api_proxy/services/wolfram_api.py index b0e03cf..175c536 100644 --- a/neon_api_proxy/services/wolfram_api.py +++ b/neon_api_proxy/services/wolfram_api.py @@ -92,7 +92,7 @@ def _build_query_string(**kwargs) -> str: query_params = dict() query_params['i'] = kwargs.get("query") query_params['units'] = kwargs.get("units") if \ - kwargs.get("units", kwargs.get("unit")) == "metric" else "imperial" + kwargs.get("units") == "metric" else "imperial" lat = kwargs.get("lat") lng = kwargs.get("lng") if kwargs.get("latlong"):