Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that API tracer returns the right value types #142

Closed
Oberon00 opened this issue Sep 17, 2019 · 3 comments · Fixed by #307
Closed

Ensure that API tracer returns the right value types #142

Oberon00 opened this issue Sep 17, 2019 · 3 comments · Fixed by #307
Assignees
Labels
api Affects the API package. bug Something isn't working tracing
Milestone

Comments

@Oberon00
Copy link
Member

See https://github.com/open-telemetry/opentelemetry-python/pull/141/files#r325107543.

Also check mypy configuration to see why this is missed.

@Oberon00 Oberon00 added the bug Something isn't working label Sep 17, 2019
@mauriciovasquezbernal
Copy link
Member

I found out that mypy doesn't comply about a missing return statement when the function is empty: http://mypy-lang.blogspot.com/2016/11/mypy-046-released.html, not sure if there is a way to enable that, probably not.

@c24t c24t added this to the Alpha v0.2 milestone Oct 11, 2019
@Oberon00 Oberon00 added api Affects the API package. tracing labels Oct 28, 2019
@c24t c24t modified the milestones: Alpha v0.2, Alpha v0.3 Oct 31, 2019
@c24t
Copy link
Member

c24t commented Oct 31, 2019

We need unit tests that have well-defined -- and different! -- behavior in the case that only the API is loaded and in the case that the SDK is loaded. This could look like the example app.

See also #166. If the API ever returns instances of "interface" classes we are guaranteed to crash. One argument for using ABCs.

@codeboten
Copy link
Contributor

There's an open issue in mypy to handle empty functions with None returns python/mypy#2350

@c24t c24t closed this as completed in #307 Dec 6, 2019
c24t pushed a commit that referenced this issue Dec 6, 2019
Fixes #142

Enabling --strict mode for mypy. Added a test in the sdk and the same test in
the api to test the different behaviours between the Tracer, Span and Metric
classes.
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the API package. bug Something isn't working tracing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants