Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantin-stepanov committed Jan 25, 2018
1 parent e5f47df commit 9f25205
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions aiozipkin/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def name(self: T, span_name: str) -> T:
pass # pragma: no cover

@abstractmethod
def new_child(self: T, name: str = None, kind: str = None) -> T:
def new_child(self: T, name: OptStr = None, kind: OptStr = None) -> T:
pass # pragma: no cover

def __enter__(self: T) -> T:
Expand Down Expand Up @@ -121,8 +121,11 @@ def kind(self, span_kind: str) -> 'NoopSpan':
def name(self, span_name: str) -> 'NoopSpan':
return self

def new_child(self, name: str = None, kind: str = None) -> 'NoopSpan':
return self
def new_child(self,
name: OptStr = None,
kind: OptStr = None) -> 'NoopSpan':
context = self._tracer._next_context(self.context)
return NoopSpan(self.tracer, context)


class Span(SpanAbc):
Expand Down Expand Up @@ -185,7 +188,7 @@ def name(self, span_name: str) -> 'Span':
self._record.name(span_name)
return self

def new_child(self, name: str = None, kind: str = None) -> 'Span':
def new_child(self, name: OptStr = None, kind: OptStr = None) -> 'Span':
span = self.tracer.new_child(self.context)
if name is not None:
span.name(name)
Expand Down

0 comments on commit 9f25205

Please sign in to comment.