Skip to content

Commit

Permalink
replace None with 'null' in query paramters
Browse files Browse the repository at this point in the history
Requests skips parameters that are None.
Map 'null' string to None python type for a more native coding
  • Loading branch information
doc-sheet authored and ds committed Apr 24, 2023
1 parent 53eaca6 commit 61f9bd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pynetbox/core/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,9 @@ def filter(self, *args, **kwargs):
offset = kwargs.pop("offset") if "offset" in kwargs else None
if limit == 0 and offset is not None:
raise ValueError("offset requires a positive limit value")
filters = {x: y if y is not None else "null" for x, y in kwargs.items()}
req = Request(
filters=kwargs,
filters=filters,
base=self.url,
token=self.token,
http_session=self.api.http_session,
Expand Down

0 comments on commit 61f9bd7

Please sign in to comment.