deprecate explain's format param
This commit is contained in:
parent
5b70a451c4
commit
500b182d17
@ -977,8 +977,15 @@ class BaseQuerySet(object):
|
|||||||
:param format: format the plan before returning it
|
:param format: format the plan before returning it
|
||||||
"""
|
"""
|
||||||
plan = self._cursor.explain()
|
plan = self._cursor.explain()
|
||||||
|
|
||||||
|
# TODO remove this option completely - it's useless. If somebody
|
||||||
|
# wants to pretty-print the output, they easily can.
|
||||||
if format:
|
if format:
|
||||||
|
msg = ('"format" param of BaseQuerySet.explain has been '
|
||||||
|
'deprecated and will be removed in future versions.')
|
||||||
|
warnings.warn(msg, DeprecationWarning)
|
||||||
plan = pprint.pformat(plan)
|
plan = pprint.pformat(plan)
|
||||||
|
|
||||||
return plan
|
return plan
|
||||||
|
|
||||||
# DEPRECATED. Has no more impact on PyMongo 3+
|
# DEPRECATED. Has no more impact on PyMongo 3+
|
||||||
|
Loading…
x
Reference in New Issue
Block a user