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.

(cherry picked from commit 0ba3e29)

# Conflicts:
#	ddtrace/profiling/collector/__init__.py
#	ddtrace/profiling/collector/memalloc.py
#	ddtrace/profiling/exporter/http.py
  • Loading branch information
Yun-Kim authored and mergify[bot] committed Oct 3, 2022
1 parent d38b463 commit 468b7f3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ddtrace/profiling/collector/__init__.py
Expand Up @@ -77,5 +77,9 @@ def _create_capture_sampler(collector):

@attr.s
class CaptureSamplerCollector(Collector):
<<<<<<< HEAD
capture_pct = attr.ib(factory=attr_utils.from_env("DD_PROFILING_CAPTURE_PCT", 2.0, float))
=======
capture_pct = attr.ib(factory=attr_utils.from_env("DD_PROFILING_CAPTURE_PCT", 1.0, float))
>>>>>>> 0ba3e299 (Remove ignores for updated mypy (#4253))
_capture_sampler = attr.ib(default=attr.Factory(_create_capture_sampler, takes_self=True), init=False, repr=False)
10 changes: 10 additions & 0 deletions ddtrace/profiling/collector/memalloc.py
Expand Up @@ -88,7 +88,17 @@ class MemoryCollector(collector.PeriodicCollector):
_interval = attr.ib(default=_DEFAULT_INTERVAL, repr=False)

# TODO make this dynamic based on the 1. interval and 2. the max number of events allowed in the Recorder
<<<<<<< HEAD
_max_events = attr.ib(factory=attr_utils.from_env("_DD_PROFILING_MEMORY_EVENTS_BUFFER", _DEFAULT_MAX_EVENTS, int))
=======
_max_events = attr.ib(
factory=attr_utils.from_env(
"_DD_PROFILING_MEMORY_EVENTS_BUFFER",
_DEFAULT_MAX_EVENTS,
int,
)
)
>>>>>>> 0ba3e299 (Remove ignores for updated mypy (#4253))
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
7 changes: 7 additions & 0 deletions ddtrace/profiling/exporter/http.py
Expand Up @@ -43,7 +43,14 @@ class PprofHTTPExporter(pprof.PprofExporter):
api_key = attr.ib(default=None, type=typing.Optional[str])
# 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.
<<<<<<< HEAD
timeout = attr.ib(factory=attr_utils.from_env("DD_PROFILING_API_TIMEOUT", 10.0, float), type=float)
=======
timeout = attr.ib(
factory=attr_utils.from_env("DD_PROFILING_API_TIMEOUT", 10.0, float),
type=float,
)
>>>>>>> 0ba3e299 (Remove ignores for updated mypy (#4253))
service = attr.ib(default=None, type=typing.Optional[str])
env = attr.ib(default=None, type=typing.Optional[str])
version = attr.ib(default=None, type=typing.Optional[str])
Expand Down

0 comments on commit 468b7f3

Please sign in to comment.