Skip to content

Commit c74bc4c

Browse files
author
Emanuele Palazzetti
committed
[requests] add Deprecation Warning for client attributes
1 parent a46883a commit c74bc4c

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

ddtrace/contrib/requests/legacy.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
1+
# [Deprecation]: this module contains deprecated functions
2+
# that will be removed in newer versions of the Tracer.
13
from ddtrace import config
24

5+
from ...utils.deprecation import deprecation
6+
37

48
def _distributed_tracing(self):
5-
"""Backward compatibility"""
9+
"""Deprecated: this method has been deprecated in favor of
10+
the configuration system. It will be removed in newer versions
11+
of the Tracer.
12+
"""
13+
deprecation(
14+
name='client.distributed_tracing',
15+
message='Use the configuration object instead `config.get_from(client)[\'distributed_tracing\'`',
16+
version='1.0.0',
17+
)
618
return config.get_from(self)['distributed_tracing']
719

820

921
def _distributed_tracing_setter(self, value):
10-
"""Backward compatibility"""
22+
"""Deprecated: this method has been deprecated in favor of
23+
the configuration system. It will be removed in newer versions
24+
of the Tracer.
25+
"""
26+
deprecation(
27+
name='client.distributed_tracing',
28+
message='Use the configuration object instead `config.get_from(client)[\'distributed_tracing\'] = value`',
29+
version='1.0.0',
30+
)
1131
config.get_from(self)['distributed_tracing'] = value

0 commit comments

Comments
 (0)