-
Notifications
You must be signed in to change notification settings - Fork 306
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
Type statsd.timed #797
Comments
Yes please. Whatnot is running into this now as well and are resorting to silly things like Sub-classing DogStatsd to workaround it. I was about to open up an issue with typeshed to add types (python/typeshed#10843) but it got closed because supposedly datadogpy already supports types. Sure enough, I saw that some very basic typing is supported which is nice, but the problem with statsd.timed is really bad because it erases types we have on our own functions. That is, it does not only lack type hints itself, but it essentially removes them from our own code as well. |
I've submitted a support ticket about this issue on behalf of Whatnot here https://help.datadoghq.com/hc/en-us/requests/1381023 |
Here is our current workaround.
|
Thanks for your contribution! This issue has been automatically marked as stale because it has not had activity in the last 30 days. Note that the issue will not be automatically closed, but this notification will remind us to investigate why there's been inactivity. Thank you for participating in the Datadog open source community. If you would like this issue to remain open:
|
Note:
If you have a feature request, you should contact support so the request can be properly tracked.
Is your feature request related to a problem? Please describe.
@statsd.timed
decorator is missing type hints, which results in a decorated function losing all of its type information.https://github.com/DataDog/datadogpy/blob/master/datadog/dogstatsd/base.py#L801
Describe the solution you'd like
@statsd.timed
decorator provides proper type hints, which correctly preserver the decorated function argument types.Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: