From 07102da0745c1d6ecd76ecb4418c6d6b3a1c607f Mon Sep 17 00:00:00 2001 From: Kamil Cukrowski Date: Tue, 3 Jan 2023 08:12:04 -0500 Subject: [PATCH] api/base: cleanup parameters that are none --- nomad/api/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nomad/api/base.py b/nomad/api/base.py index 008671b..22f6e3a 100644 --- a/nomad/api/base.py +++ b/nomad/api/base.py @@ -84,6 +84,9 @@ def _query_string_builder(self, endpoint, params=None): if not isinstance(params, dict): params = {} + # Remove parameters that are None + params = {key: val for key, val in params.items() if val is not None} + if ("namespace" not in params) and (self.namespace and self._required_namespace(endpoint)): query_string["namespace"] = self.namespace