Skip to content

Commit

Permalink
Don't include parameters if the value is None
Browse files Browse the repository at this point in the history
  • Loading branch information
markallanson committed Jan 12, 2021
1 parent 3726e5d commit 6505c61
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion octopus_energy/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ async def _execute(
"""Executes an API call to Octopus energy and maps the response."""
url = self.base_url.copy()
url.path.segments.extend(url_parts)
url.query.params.update(query_params)
url.query.params.update({p: v for p, v in query_params.items() if v is not None})
response = await func(url=str(url), **kwargs)
if response.status > 399:
if response.status == HTTPStatus.UNAUTHORIZED:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "octopus-energy"
version = "0.1.8"
version = "0.1.9"
description = "Python client for the Octopus Energy RESTful API"
authors = ["Mark Allanson <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 6505c61

Please sign in to comment.