Skip to content

Commit

Permalink
Mypy fixes (#6646)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyan99 authored Aug 3, 2019
1 parent 46c7ad6 commit 5b5ed26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sdk/core/azure-core/azure/core/polling/poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def result(self, timeout=None):
if one is available.
:raises CloudError: Server problem with the query.
"""
self.wait(timeout)
self.wait(timeout) # type: ignore
return self._polling_method.resource()

@distributed_trace
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/azure-core/azure/core/tracing/decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ def wrapper_use_tracer(*args, **kwargs):
ans = None
if parent_span is not None and orig_wrapped_span is None:
common.set_span_contexts(parent_span)
name = name_of_span or common.get_function_and_class_name(func, *args)
name = name_of_span or common.get_function_and_class_name(func, *args) # type: ignore
child = parent_span.span(name=name)
child.start()
common.set_span_contexts(child)
ans = func(*args, **kwargs)
ans = func(*args, **kwargs) # type: ignore
child.finish()
common.set_span_contexts(parent_span)
if orig_wrapped_span is None and passed_in_parent is None and original_span_instance is None:
parent_span.finish()
common.set_span_contexts(orig_wrapped_span, span_instance=original_span_instance)
else:
ans = func(*args, **kwargs)
ans = func(*args, **kwargs) # type: ignore
return ans

return wrapper_use_tracer
6 changes: 3 additions & 3 deletions sdk/core/azure-core/azure/core/tracing/decorator_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,18 @@ async def wrapper_use_tracer(*args, **kwargs):
ans = None
if parent_span is not None and orig_wrapped_span is None:
common.set_span_contexts(parent_span)
name = name_of_span or common.get_function_and_class_name(func, *args)
name = name_of_span or common.get_function_and_class_name(func, *args) # type: ignore
child = parent_span.span(name=name)
child.start()
common.set_span_contexts(child)
ans = await func(*args, **kwargs)
ans = await func(*args, **kwargs) # type: ignore
child.finish()
common.set_span_contexts(parent_span)
if orig_wrapped_span is None and passed_in_parent is None and original_span_instance is None:
parent_span.finish()
common.set_span_contexts(orig_wrapped_span, span_instance=original_span_instance)
else:
ans = await func(*args, **kwargs)
ans = await func(*args, **kwargs) # type: ignore
return ans

return wrapper_use_tracer

0 comments on commit 5b5ed26

Please sign in to comment.