From 095ed8f244f6cda5079373091ab78b202ad05756 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Wed, 16 Oct 2019 12:14:18 -0700 Subject: [PATCH] Update lookup_api.py --- nested_lookup/lookup_api.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nested_lookup/lookup_api.py b/nested_lookup/lookup_api.py index 0f8946a..5d25dbf 100644 --- a/nested_lookup/lookup_api.py +++ b/nested_lookup/lookup_api.py @@ -60,7 +60,7 @@ def nested_update(document, key, value, in_place=False, treat_as_element=True): # check the length of the list and provide it to _nested_update if not treat_as_element and not isinstance(value, list): raise Exception( - "You need to pass value as list if you opt for" + "this feature" + "The value must be a list when treat_as_element is False." ) elif treat_as_element: value = [value] @@ -106,7 +106,7 @@ def nested_alter( function_parameters=None, conversion_function=None, wild_alter=False, - in_place=True, + in_place=False, ): """ Method to alter all values of the occurences of the key "key". @@ -190,8 +190,7 @@ def _nested_alter( in_place, key_len, ): - """ - """ + # return data if no callback_function is provided if callback_function is None: warnings.warn("Please provide a callback_function to nested_alter().")