@@ -210,20 +210,25 @@ def find(
210210 self ,
211211 id : str ,
212212 event_context : EventContext ,
213- peeker : Callable = None ,
214213 visible_only = True ,
215214 mapper : Callable = None ,
216215 ):
217216 partition_key_value = self .find_partition_key_value (event_context )
218217 found_item = self .container .read_item (id , partition_key_value )
219- if peeker :
220- peeker (found_item )
221-
222218 function_mapper = self .get_mapper_or_dict (mapper )
223219 return function_mapper (self .check_visibility (found_item , visible_only ))
224220
225- def find_all (self , event_context : EventContext , conditions : dict = {}, custom_sql_conditions : List [str ] = [],
226- custom_params : dict = {}, max_count = None , offset = 0 , visible_only = True , mapper : Callable = None ):
221+ def find_all (
222+ self ,
223+ event_context : EventContext ,
224+ conditions : dict = {},
225+ custom_sql_conditions : List [str ] = [],
226+ custom_params : dict = {},
227+ max_count = None ,
228+ offset = 0 ,
229+ visible_only = True ,
230+ mapper : Callable = None ,
231+ ):
227232 partition_key_value = self .find_partition_key_value (event_context )
228233 max_count = self .get_page_size_or (max_count )
229234 params = [
@@ -242,16 +247,16 @@ def find_all(self, event_context: EventContext, conditions: dict = {}, custom_sq
242247 {order_clause}
243248 OFFSET @offset LIMIT @max_count
244249 """ .format (
245- partition_key_attribute = self .partition_key_attribute ,
246- visibility_condition = self .create_sql_condition_for_visibility (
247- visible_only
248- ),
249- conditions_clause = self .create_sql_where_conditions (conditions ),
250- custom_sql_conditions_clause = self .create_custom_sql_conditions (
251- custom_sql_conditions
252- ),
253- order_clause = self .create_sql_order_clause (),
254- )
250+ partition_key_attribute = self .partition_key_attribute ,
251+ visibility_condition = self .create_sql_condition_for_visibility (
252+ visible_only
253+ ),
254+ conditions_clause = self .create_sql_where_conditions (conditions ),
255+ custom_sql_conditions_clause = self .create_custom_sql_conditions (
256+ custom_sql_conditions
257+ ),
258+ order_clause = self .create_sql_order_clause (),
259+ )
255260
256261 result = self .container .query_items (
257262 query = query_str ,
@@ -268,16 +273,11 @@ def partial_update(
268273 id : str ,
269274 changes : dict ,
270275 event_context : EventContext ,
271- peeker : Callable = None ,
272276 visible_only = True ,
273277 mapper : Callable = None ,
274278 ):
275279 item_data = self .find (
276- id ,
277- event_context ,
278- peeker = peeker ,
279- visible_only = visible_only ,
280- mapper = dict ,
280+ id , event_context , visible_only = visible_only , mapper = dict ,
281281 )
282282 item_data .update (changes )
283283 return self .update (id , item_data , event_context , mapper = mapper )
@@ -295,17 +295,12 @@ def update(
295295 return function_mapper (self .container .replace_item (id , body = item_data ))
296296
297297 def delete (
298- self ,
299- id : str ,
300- event_context : EventContext ,
301- peeker : Callable = None ,
302- mapper : Callable = None ,
298+ self , id : str , event_context : EventContext , mapper : Callable = None ,
303299 ):
304300 return self .partial_update (
305301 id ,
306302 {'deleted' : generate_uuid4 ()},
307303 event_context ,
308- peeker = peeker ,
309304 visible_only = True ,
310305 mapper = mapper ,
311306 )
0 commit comments