Skip to content

Commit 7954ec6

Browse files
committed
undo py version check removal and fix langchain/tornado
1 parent deeeb84 commit 7954ec6

File tree

4 files changed

+4
-29
lines changed

4 files changed

+4
-29
lines changed

ddtrace/__init__.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@
2626
from ._monkey import patch # noqa: E402
2727
from ._monkey import patch_all # noqa: E402
2828
from .internal.compat import PYTHON_VERSION_INFO # noqa: E402
29-
from .internal.utils.deprecations import DDTraceDeprecationWarning # noqa: E402
30-
from ddtrace._trace.pin import Pin # noqa: E402
31-
from ddtrace._trace.span import Span # noqa: E402
32-
from ddtrace._trace.tracer import Tracer # noqa: E402
3329
from ddtrace.vendor import debtcollector
3430
from .version import get_version # noqa: E402
31+
from .internal.utils.deprecations import DDTraceDeprecationWarning # noqa: E402
3532

3633

3734
# TODO(mabdinur): Remove this once we have a better way to start the mini agent
@@ -65,28 +62,6 @@
6562
]
6663

6764

68-
_DEPRECATED_TRACE_ATTRIBUTES = [
69-
"Span",
70-
"Tracer",
71-
"Pin",
72-
]
73-
74-
75-
def __getattr__(name):
76-
if name in _DEPRECATED_TRACE_ATTRIBUTES:
77-
debtcollector.deprecate(
78-
("%s.%s is deprecated" % (__name__, name)),
79-
message="Import from ddtrace.trace instead.",
80-
category=DDTraceDeprecationWarning,
81-
removal_version="3.0.0",
82-
)
83-
84-
if name in globals():
85-
return globals()[name]
86-
87-
raise AttributeError("%s has no attribute %s", __name__, name)
88-
89-
9065
def check_supported_python_version():
9166
if PYTHON_VERSION_INFO < (3, 8):
9267
deprecation_message = (

ddtrace/contrib/internal/langchain/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939

4040
import wrapt
4141

42-
from ddtrace import Span
4342
from ddtrace import config
4443
from ddtrace.contrib.internal.langchain.constants import API_KEY
4544
from ddtrace.contrib.internal.langchain.constants import COMPLETION_TOKENS
@@ -63,6 +62,7 @@
6362
from ddtrace.llmobs._integrations import LangChainIntegration
6463
from ddtrace.llmobs._utils import safe_json
6564
from ddtrace.trace import Pin
65+
from ddtrace.trace import Span
6666

6767

6868
log = get_logger(__name__)

ddtrace/contrib/internal/langgraph/patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from ddtrace.contrib.trace_utils import wrap
1010
from ddtrace.internal.utils import get_argument_value
1111
from ddtrace.llmobs._integrations.langgraph import LangGraphIntegration
12-
from ddtrace.pin import Pin
12+
from ddtrace.trace import Pin
1313

1414

1515
def get_version():

ddtrace/contrib/internal/tornado/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def tracer_config(__init__, app, args, kwargs):
5656

5757
# configure the PIN object for template rendering
5858
# Required for backwards compatibility. Remove the else clause when
59-
# the `ddtrace.Pin` object no longer accepts the Pin argument.
59+
# the `ddtrace.trace.Pin` object no longer accepts the Pin argument.
6060
if tracer is ddtrace.tracer:
6161
ddtrace.trace.Pin(service=service).onto(template)
6262
else:

0 commit comments

Comments
 (0)