Skip to content

Commit

Permalink
Fix kwarg handling for backend compat. (#22)
Browse files Browse the repository at this point in the history
# 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>
  • Loading branch information
NeonDaniel and NeonDaniel authored May 6, 2024
1 parent 31064f6 commit abfdb2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions neon_hana/mq_service_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ def get_session(self, node_data: NodeData) -> dict:
def query_api_proxy(self, service_name: str, query_params: dict,
timeout: int = 10):
query_params['service'] = service_name
if service_name in ("open_weather_map", "wolfram_alpha"):
query_params['units'] = query_params.pop('unit',
query_params.get('units'))
response = send_mq_request("/neon_api", query_params, "neon_api_input",
"neon_api_output", timeout)
return self._validate_api_proxy_response(response, query_params)
Expand Down

0 comments on commit abfdb2d

Please sign in to comment.