@@ -238,16 +238,16 @@ def check_commands(
238
238
239
239
if path .index or op in ["remove" , "replace" , "test" ] or from_path :
240
240
commands .add (
241
- f"if (!ctx._source. { path .es_nest } .containsKey('{ path .key } '))"
241
+ f"if (!ctx._source{ path .es_nest } .containsKey('{ path .key } '))"
242
242
f"{{Debug.explain('{ path .key } does not exist in { path .nest } ');}}"
243
243
)
244
244
245
245
if from_path and path .index is not None :
246
246
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 } ')))"
251
251
f"{{Debug.explain('{ path .path } does not exist');}}"
252
252
)
253
253
@@ -262,12 +262,12 @@ def remove_commands(commands: ESCommandSet, path: ElasticPath) -> None:
262
262
"""
263
263
if path .index is not None :
264
264
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 } );"
266
266
)
267
267
268
268
else :
269
269
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 } ');"
271
271
)
272
272
273
273
@@ -298,8 +298,8 @@ def add_commands(
298
298
299
299
if path .index is not None :
300
300
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 } )}}"
303
303
f"else{{ctx._source.{ path .es_path } = { value } }}"
304
304
)
305
305
0 commit comments