@@ -238,16 +238,16 @@ def check_commands(
238238
239239 if path .index or op in ["remove" , "replace" , "test" ] or from_path :
240240 commands .add (
241- f"if (!ctx._source. { path .es_nest } .containsKey('{ path .key } '))"
241+ f"if (!ctx._source{ path .es_nest } .containsKey('{ path .key } '))"
242242 f"{{Debug.explain('{ path .key } does not exist in { path .nest } ');}}"
243243 )
244244
245245 if from_path and path .index is not None :
246246 commands .add (
247- f"if ((ctx._source. { path .es_location } instanceof ArrayList"
248- f" && ctx._source. { path .es_location } .size() < { path .index } )"
249- f" || (!(ctx._source. { path .es_location } instanceof ArrayList)"
250- f" && !ctx._source. { path .es_location } .containsKey('{ path .index } ')))"
247+ f"if ((ctx._source{ path .es_location } instanceof ArrayList"
248+ f" && ctx._source{ path .es_location } .size() < { path .index } )"
249+ f" || (!(ctx._source{ path .es_location } instanceof ArrayList)"
250+ f" && !ctx._source{ path .es_location } .containsKey('{ path .index } ')))"
251251 f"{{Debug.explain('{ path .path } does not exist');}}"
252252 )
253253
@@ -262,12 +262,12 @@ def remove_commands(commands: ESCommandSet, path: ElasticPath) -> None:
262262 """
263263 if path .index is not None :
264264 commands .add (
265- f"def { path .variable_name } = ctx._source. { path .es_location } .remove({ path .index } );"
265+ f"def { path .variable_name } = ctx._source{ path .es_location } .remove({ path .index } );"
266266 )
267267
268268 else :
269269 commands .add (
270- f"def { path .variable_name } = ctx._source. { path .es_nest } .remove('{ path .key } ');"
270+ f"def { path .variable_name } = ctx._source{ path .es_nest } .remove('{ path .key } ');"
271271 )
272272
273273
@@ -298,8 +298,8 @@ def add_commands(
298298
299299 if path .index is not None :
300300 commands .add (
301- f"if (ctx._source. { path .es_location } instanceof ArrayList)"
302- f"{{ctx._source. { path .es_location } .{ 'add' if operation .op in ['add' , 'move' ] else 'set' } ({ path .index } , { value } )}}"
301+ f"if (ctx._source{ path .es_location } instanceof ArrayList)"
302+ f"{{ctx._source{ path .es_location } .{ 'add' if operation .op in ['add' , 'move' ] else 'set' } ({ path .index } , { value } )}}"
303303 f"else{{ctx._source.{ path .es_path } = { value } }}"
304304 )
305305
0 commit comments