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

Mypy error: Module "datadog" does not explicitly export attribute "statsd" [attr-defined] #842

Open
tuukkamustonen opened this issue Jul 6, 2024 · 4 comments
Labels
kind/bug Bug related issue stale Stale - Bot reminder

Comments

@tuukkamustonen
Copy link

from datadog import statsd

Mypy nags:

foo.py:1: error: Module "datadog" does not explicitly export attribute "statsd"  [attr-defined]

That's because datadog.__init__ doesn't explicitly expose the module imported in its __all__ = []. See https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-no-implicit-reexport.

mypy --strict enables that check, so I assume others will bump into it, too.

datadog==0.49.1
mypy=1.10.0
@tuukkamustonen tuukkamustonen added the kind/bug Bug related issue label Jul 6, 2024
Copy link

github-actions bot commented Aug 6, 2024

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:

  1. Verify that you can still reproduce the issue in the latest version of this project.

  2. Comment that the issue is still reproducible and include updated details requested in the issue template.

@github-actions github-actions bot added the stale Stale - Bot reminder label Aug 6, 2024
@tuukkamustonen
Copy link
Author

tuukkamustonen commented Aug 6, 2024

Your bot here is quite aggressive. A bit ridiculous to close tickets after 30d. 180d or such would make more sense.

Yes, I believe the issue is still valid.

@JakubOrsula
Copy link

JakubOrsula commented Sep 27, 2024

I can confirm that the issue is still reproducible on
mypy==1.11.2, datadog==0.50.0 and python 3.12.

@JakubOrsula
Copy link

If you want to avoid # noqa or # type:ignore use

from datadog.dogstatsd.base import statsd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Bug related issue stale Stale - Bot reminder
Projects
None yet
Development

No branches or pull requests

2 participants