@@ -295,34 +295,6 @@ def test_get_source(instrument, elasticapm_client, elasticsearch):
295295 assert "statement" not in span ["context" ]["db" ]
296296
297297
298- @pytest .mark .skipif (ES_VERSION [0 ] < 5 , reason = "unsupported method" )
299- @pytest .mark .integrationtest
300- def test_update_script (instrument , elasticapm_client , elasticsearch ):
301- elasticsearch .create (
302- index = "tweets" , doc_type = document_type , id = 1 , body = {"user" : "kimchy" , "text" : "hola" }, refresh = True
303- )
304- elasticapm_client .begin_transaction ("test" )
305- r1 = elasticsearch .update (
306- index = "tweets" , id = 1 , doc_type = document_type , body = {"script" : "ctx._source.text = 'adios'" }, refresh = True
307- )
308- elasticapm_client .end_transaction ("test" , "OK" )
309-
310- transaction = elasticapm_client .events [TRANSACTION ][0 ]
311- r2 = elasticsearch .get (index = "tweets" , doc_type = document_type , id = 1 )
312- assert r1 ["result" ] == "updated"
313- assert r2 ["_source" ] == {"user" : "kimchy" , "text" : "adios" }
314- spans = elasticapm_client .spans_for_transaction (transaction )
315- assert len (spans ) == 1
316-
317- span = spans [0 ]
318- assert span ["name" ] == "ES POST /tweets/%s/1/_update" % document_type
319- assert span ["type" ] == "db"
320- assert span ["subtype" ] == "elasticsearch"
321- assert span ["action" ] == "query"
322- assert span ["context" ]["db" ]["type" ] == "elasticsearch"
323- assert span ["context" ]["db" ]["statement" ] == '{"script": "ctx._source.text = \' adios\' "}'
324-
325-
326298@pytest .mark .integrationtest
327299def test_update_document (instrument , elasticapm_client , elasticsearch ):
328300 elasticsearch .create (
@@ -356,7 +328,7 @@ def test_search_body(instrument, elasticapm_client, elasticsearch):
356328 )
357329 elasticapm_client .begin_transaction ("test" )
358330 search_query = {"query" : {"term" : {"user" : "kimchy" }}, "sort" : ["userid" ]}
359- result = elasticsearch .search (body = search_query , params = None )
331+ result = elasticsearch .search (body = search_query )
360332 elasticapm_client .end_transaction ("test" , "OK" )
361333
362334 transaction = elasticapm_client .events [TRANSACTION ][0 ]
@@ -500,28 +472,6 @@ def test_delete(instrument, elasticapm_client, elasticsearch):
500472 assert span ["context" ]["db" ]["type" ] == "elasticsearch"
501473
502474
503- @pytest .mark .skipif (ES_VERSION [0 ] < 5 , reason = "unsupported method" )
504- @pytest .mark .integrationtest
505- def test_delete_by_query_body (instrument , elasticapm_client , elasticsearch ):
506- elasticsearch .create (
507- index = "tweets" , doc_type = document_type , id = 1 , body = {"user" : "kimchy" , "text" : "hola" }, refresh = True
508- )
509- elasticapm_client .begin_transaction ("test" )
510- result = elasticsearch .delete_by_query (index = "tweets" , body = {"query" : {"term" : {"user" : "kimchy" }}})
511- elasticapm_client .end_transaction ("test" , "OK" )
512-
513- transaction = elasticapm_client .events [TRANSACTION ][0 ]
514- spans = elasticapm_client .spans_for_transaction (transaction )
515-
516- span = spans [0 ]
517- assert span ["name" ] == "ES POST /tweets/_delete_by_query"
518- assert span ["type" ] == "db"
519- assert span ["subtype" ] == "elasticsearch"
520- assert span ["action" ] == "query"
521- assert span ["context" ]["db" ]["type" ] == "elasticsearch"
522- assert json .loads (span ["context" ]["db" ]["statement" ]) == json .loads ('{"query":{"term":{"user":"kimchy"}}}' )
523-
524-
525475@pytest .mark .integrationtest
526476def test_multiple_indexes (instrument , elasticapm_client , elasticsearch ):
527477 elasticsearch .create (index = "tweets" , doc_type = "users" , id = 1 , body = {"user" : "kimchy" , "text" : "hola" }, refresh = True )
@@ -571,7 +521,7 @@ def test_custom_serializer(instrument, elasticapm_client, elasticsearch):
571521 elasticsearch .index (index = "test-index" , body = {"2" : 1 })
572522 elasticapm_client .begin_transaction ("test" )
573523 search_query = {"query" : {"term" : {NumberObj (2 ): {"value" : 1 }}}}
574- result = elasticsearch .search (index = "test-index" , body = search_query , params = None )
524+ result = elasticsearch .search (index = "test-index" , body = search_query )
575525 elasticapm_client .end_transaction ("test" , "OK" )
576526
577527 transaction = elasticapm_client .events [TRANSACTION ][0 ]
0 commit comments