Skip to content

Commit abfdb2d

Browse files
authored
Fix kwarg handling for backend compat. (#22)
# Description Fix `unit`/`units` compat. issue with API proxy service # Issues <!-- If this is related to or closes an issue/other PR, please note them here --> # Other Notes As noted [on Matrix](https://matrix.to/#/!ZhEZYNzKBfpEAhtQIz:matrix.org/$FunTJOligMlv8gr_ewqKKaMOrTKje7RaK6xiFeC0cEc?via=matrix.org&via=nitro.chat&via=rx.haunted.computer) Co-authored-by: Daniel McKnight <daniel@neon.ai>
1 parent 31064f6 commit abfdb2d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

neon_hana/mq_service_api.py

+3
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ def get_session(self, node_data: NodeData) -> dict:
9292
def query_api_proxy(self, service_name: str, query_params: dict,
9393
timeout: int = 10):
9494
query_params['service'] = service_name
95+
if service_name in ("open_weather_map", "wolfram_alpha"):
96+
query_params['units'] = query_params.pop('unit',
97+
query_params.get('units'))
9598
response = send_mq_request("/neon_api", query_params, "neon_api_input",
9699
"neon_api_output", timeout)
97100
return self._validate_api_proxy_response(response, query_params)

0 commit comments

Comments
 (0)