Skip to content

Commit

Permalink
Please the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
xrmx committed Mar 19, 2024
1 parent bd5e494 commit de54284
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,9 @@ def wrapper(wrapped, _, args, kwargs):
if body:
# Don't set db.statement for bulk requests, as it can be very large
if isinstance(body, dict):
attributes[SpanAttributes.DB_STATEMENT] = sanitize_body(
body
)
attributes[
SpanAttributes.DB_STATEMENT
] = sanitize_body(body)
if params:
attributes["elasticsearch.params"] = str(params)
if doc_id:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,24 @@ def test_bulk(self, request_mock):
request_mock.return_value = (1, {}, "")

es = Elasticsearch()
es.bulk([dict(_op_type="index", _index="sw", _doc_type="_doc", _id=1, doc={"name": "adam"})] * 2)
es.bulk(
[
{
"_op_type": "index",
"_index": "sw",
"_doc_type": "_doc",
"_id": 1,
"doc": {"name": "adam"},
},
{
"_op_type": "index",
"_index": "sw",
"_doc_type": "_doc",
"_id": 1,
"doc": {"name": "adam"},
},
]
)

spans_list = self.get_finished_spans()
self.assertEqual(len(spans_list), 1)
Expand Down

0 comments on commit de54284

Please sign in to comment.