DataDog / datadogpy

The Datadog Python library
https://datadoghq.com/
Other
610 stars 302 forks source link

Cannot import DEFAULT_FLUSH_INTERVAL from datadog.dogstatsd.base #852

Closed calobsymonds closed 4 days ago

calobsymonds commented 3 weeks ago

Describe the bug The constant datadog.dogstatsd.base.DEFAULT_FLUSH_INTERVAL is no longer importable as it was in prior versions.

Label the issue properly.

To Reproduce

  1. Install datadog version 0.50.0
  2. Attempt to run from datadog.dogstatsd.base import DEFAULT_FLUSH_INTERVAL
Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datadog.dogstatsd.base import DEFAULT_FLUSH_INTERVAL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'DEFAULT_FLUSH_INTERVAL' from 'datadog.dogstatsd.base' (<OBFUSCATED>/Python/3.10/lib/python/site-packages/datadog/dogstatsd/base.py)

Expected behavior The import should succeed, as it did in versions 0.49.0 and prior.

Environment and Versions (please complete the following information):

Python info Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin

Datadog package info (from pip):

Name: datadog
Version: 0.50.0
Summary: The Datadog Python library
Home-page: 
Author: 
Author-email: "Datadog, Inc." <dev@datadoghq.com>
License: BSD-3-Clause
Location: /Users/calobs/Library/Python/3.10/lib/python/site-packages
Requires: requests
Required-by: 
calobsymonds commented 3 weeks ago

You'll have to forgive me; I'm not a common GitHub user and I can't figure out how to apply a label (which should probably be severity/minor)

ggierse commented 4 days ago

Having the same problem

sgnn7 commented 4 days ago

Hi @calobsymonds / @ggierse ,

From looking at the code history, the variable name was changed from DEFAULT_FLUSH_INTERVAL to DEFAULT_BUFFERING_FLUSH_INTERVAL here.

# Buffering-related values (in seconds)
- DEFAULT_FLUSH_INTERVAL = 0.3
+ DEFAULT_BUFFERING_FLUSH_INTERVAL = 0.3

This change does look like it's fixed/reverted by #851 for the next release (v0.51.x) when you will be able to use the old variable again so I'll close this issue as resolved. Feel free to reopen if needed.