Skip to content

Commit b37df46

Browse files
author
Michal Kuffa
committed
Fix callback signature in README and minor test update
1 parent 251bed1 commit b37df46

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ send metrics based on span, result attributes.
173173
from datadog import statsd
174174
from ddtrace_graphql import patch, CLIENT_ERROR, INVALID
175175
176-
def callback(result=result, span=span):
176+
def callback(result, span):
177177
tags = ['resource:{}'.format(span.resource.replace(' ', '_'))]
178178
statsd.increment('{}.request'.format(span.service), tags=tags)
179179
if span.error:

tests/test_graphql.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ def test_resource():
296296
@staticmethod
297297
def test_span_callback():
298298
cb_args = {}
299-
def test_cb(**kwargs):
300-
cb_args.update(kwargs)
299+
def test_cb(result, span):
300+
cb_args.update(dict(result=result, span=span))
301301
query = '{ hello world }'
302302
tracer, schema = get_traced_schema()
303303
result = traced_graphql(schema, query, span_callback=test_cb)

0 commit comments

Comments
 (0)