From 61f9bd7ab932dd8b34adfeec7e4fd59450d08811 Mon Sep 17 00:00:00 2001 From: Nikita Korolev <66738864+doc-sheet@users.noreply.github.com> Date: Mon, 24 Apr 2023 00:04:41 +0000 Subject: [PATCH] replace None with 'null' in query paramters Requests skips parameters that are None. Map 'null' string to None python type for a more native coding --- pynetbox/core/endpoint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pynetbox/core/endpoint.py b/pynetbox/core/endpoint.py index 6ba6d015..83ef566e 100644 --- a/pynetbox/core/endpoint.py +++ b/pynetbox/core/endpoint.py @@ -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,