Skip to content

Commit

Permalink
Remove ignores for updated mypy (#4253)
Browse files Browse the repository at this point in the history
Mypy==0.982 has just been released and fixed the inherent type/callable type hinting that was the problem from #4234. As a result, the type ignore comments added in #4234 to bypass the type/callable issue are not unneeded and are breaking CI.
  • Loading branch information
Yun-Kim authored Oct 3, 2022
1 parent 82b1521 commit 0ba3e29
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ddtrace/profiling/collector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ def _create_capture_sampler(collector):

@attr.s
class CaptureSamplerCollector(Collector):
capture_pct = attr.ib(factory=attr_utils.from_env("DD_PROFILING_CAPTURE_PCT", 1.0, float)) # type: ignore[arg-type]
capture_pct = attr.ib(factory=attr_utils.from_env("DD_PROFILING_CAPTURE_PCT", 1.0, float))
_capture_sampler = attr.ib(default=attr.Factory(_create_capture_sampler, takes_self=True), init=False, repr=False)
2 changes: 1 addition & 1 deletion ddtrace/profiling/collector/_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __get__(self, instance, owner=None):
class LockCollector(collector.CaptureSamplerCollector):
"""Record lock usage."""

nframes = attr.ib(factory=attr_utils.from_env("DD_PROFILING_MAX_FRAMES", 64, int)) # type: ignore[arg-type]
nframes = attr.ib(factory=attr_utils.from_env("DD_PROFILING_MAX_FRAMES", 64, int))
endpoint_collection_enabled = attr.ib(
factory=attr_utils.from_env("DD_PROFILING_ENDPOINT_COLLECTION_ENABLED", True, formats.asbool)
)
Expand Down
4 changes: 2 additions & 2 deletions ddtrace/profiling/collector/memalloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ class MemoryCollector(collector.PeriodicCollector):
factory=attr_utils.from_env(
"_DD_PROFILING_MEMORY_EVENTS_BUFFER",
_DEFAULT_MAX_EVENTS,
int, # type: ignore[arg-type]
int,
)
)
max_nframe = attr.ib(factory=attr_utils.from_env("DD_PROFILING_MAX_FRAMES", 64, int)) # type: ignore[arg-type]
max_nframe = attr.ib(factory=attr_utils.from_env("DD_PROFILING_MAX_FRAMES", 64, int))
heap_sample_size = attr.ib(type=int, factory=_get_default_heap_sample_size)
ignore_profiler = attr.ib(factory=attr_utils.from_env("DD_PROFILING_IGNORE_PROFILER", False, formats.asbool))

Expand Down
2 changes: 1 addition & 1 deletion ddtrace/profiling/exporter/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PprofHTTPExporter(pprof.PprofExporter):
# Do not use the default agent timeout: it is too short, the agent is just a unbuffered proxy and the profiling
# backend is not as fast as the tracer one.
timeout = attr.ib(
factory=attr_utils.from_env("DD_PROFILING_API_TIMEOUT", 10.0, float), # type: ignore[arg-type]
factory=attr_utils.from_env("DD_PROFILING_API_TIMEOUT", 10.0, float),
type=float,
)
service = attr.ib(default=None, type=typing.Optional[str])
Expand Down
4 changes: 1 addition & 3 deletions ddtrace/profiling/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ class Scheduler(periodic.PeriodicService):
recorder = attr.ib()
exporters = attr.ib()
before_flush = attr.ib(default=None, eq=False)
_interval = attr.ib(
factory=attr_utils.from_env("DD_PROFILING_UPLOAD_INTERVAL", 60.0, float) # type: ignore[arg-type]
)
_interval = attr.ib(factory=attr_utils.from_env("DD_PROFILING_UPLOAD_INTERVAL", 60.0, float))
_configured_interval = attr.ib(init=False)
_last_export = attr.ib(init=False, default=None, eq=False)

Expand Down

0 comments on commit 0ba3e29

Please sign in to comment.