None for parameter value should cause that param to be ignored
Fixes #375
This commit is contained in:
@@ -9,6 +9,8 @@ Changelog
|
||||
Version compatible with elasticsearch 5.0
|
||||
|
||||
* added ``headers`` arg to connections to support custom http headers
|
||||
* passing in a keyword parameter with ``None`` as value will cause that param
|
||||
to be ignored
|
||||
|
||||
2.3.0 (2016-02-29)
|
||||
------------------
|
||||
|
||||
@@ -33,7 +33,7 @@ def _escape(value):
|
||||
except UnicodeDecodeError:
|
||||
# Python 2 and str, no need to re-encode
|
||||
pass
|
||||
|
||||
|
||||
return str(value)
|
||||
|
||||
def _make_path(*parts):
|
||||
@@ -60,7 +60,9 @@ def query_params(*es_query_params):
|
||||
params = kwargs.pop('params', {})
|
||||
for p in es_query_params + GLOBAL_PARAMS:
|
||||
if p in kwargs:
|
||||
params[p] = _escape(kwargs.pop(p))
|
||||
v = kwargs.pop(p)
|
||||
if v is not None:
|
||||
params[p] = _escape(v)
|
||||
|
||||
# don't treat ignore and request_timeout as other params to avoid escaping
|
||||
for p in ('ignore', 'request_timeout'):
|
||||
|
||||
Reference in New Issue
Block a user