Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur committed Jan 11, 2025
1 parent e220b5e commit 6eeb373
Show file tree
Hide file tree
Showing 23 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion benchmarks/bm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

from ddtrace import __version__ as ddtrace_version
from ddtrace._trace.span import Span
from ddtrace.trace import TraceFilter
from ddtrace.internal import telemetry
from ddtrace.trace import TraceFilter


_Span = Span
Expand Down
14 changes: 7 additions & 7 deletions ddtrace/_trace/pin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ def __repr__(self):
def _find(*objs):
# type: (Any) -> Optional[Pin]
"""
Return the first :class:`ddtrace.trace.Pin.Pin` found on any of the provided objects or `None` if none were found
Return the first :class:`ddtrace.trace.Pin` found on any of the provided objects or `None` if none were found
>>> pin = Pin._find(wrapper, instance, conn)
:param objs: The objects to search for a :class:`ddtrace.trace.Pin.Pin` on
:param objs: The objects to search for a :class:`ddtrace.trace.Pin` on
:type objs: List of objects
:rtype: :class:`ddtrace.trace.Pin.Pin`, None
:returns: The first found :class:`ddtrace.trace.Pin.Pin` or `None` is none was found
:rtype: :class:`ddtrace.trace.Pin`, None
:returns: The first found :class:`ddtrace.trace.Pin` or `None` is none was found
"""
for obj in objs:
pin = Pin.get_from(obj)
Expand All @@ -98,10 +98,10 @@ def get_from(obj):
>>> pin = Pin.get_from(conn)
:param obj: The object to look for a :class:`ddtrace.trace.Pin.Pin` on
:param obj: The object to look for a :class:`ddtrace.trace.Pin` on
:type obj: object
:rtype: :class:`ddtrace.trace.Pin.Pin`, None
:returns: :class:`ddtrace.trace.Pin.Pin` associated with the object, or None if none was found
:rtype: :class:`ddtrace.trace.Pin`, None
:returns: :class:`ddtrace.trace.Pin` associated with the object or None
"""
if hasattr(obj, "__getddpin__"):
return obj.__getddpin__()
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/_trace/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from ddtrace.constants import HOSTNAME_KEY
from ddtrace.constants import PID
from ddtrace.constants import VERSION_KEY
from ddtrace.trace import TraceFilter
from ddtrace.internal import agent
from ddtrace.internal import atexit
from ddtrace.internal import compat
Expand Down Expand Up @@ -69,6 +68,7 @@
from ddtrace.settings import Config
from ddtrace.settings.asm import config as asm_config
from ddtrace.settings.peer_service import _ps_config
from ddtrace.trace import TraceFilter
from ddtrace.vendor.debtcollector import deprecate


Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/aiohttp/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
from ddtrace.internal.schema.span_attribute_schema import SpanDirection
from ddtrace.internal.utils import get_argument_value
from ddtrace.internal.utils.formats import asbool
from ddtrace.trace import Pin
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.trace import Pin


log = get_logger(__name__)
Expand Down
6 changes: 3 additions & 3 deletions ddtrace/contrib/internal/asgi/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ async def __call__(self, scope, receive, send):
if scope["type"] == "http":
operation_name = schematize_url_operation(operation_name, direction=SpanDirection.INBOUND, protocol="http")

# Calling ddtrace.trace.Pin.Pin(...) with the `tracer` argument is deprecated
# Calling ddtrace.trace.Pin(...) with the `tracer` argument is deprecated
# Remove this if statement when the `tracer` argument is removed
if self.tracer is ddtrace.tracer:
pin = ddtrace.trace.Pin.Pin(service="asgi")
pin = ddtrace.trace.Pin(service="asgi")
else:
pin = ddtrace.trace.Pin.Pin(service="asgi", tracer=self.tracer)
pin = ddtrace.trace.Pin(service="asgi", tracer=self.tracer)

with core.context_with_data(
"asgi.__call__",
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/botocore/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
from ddtrace.internal.utils.formats import asbool
from ddtrace.internal.utils.formats import deep_getattr
from ddtrace.llmobs._integrations import BedrockIntegration
from ddtrace.trace import Pin
from ddtrace.settings.config import Config
from ddtrace.trace import Pin

from .services.bedrock import patched_bedrock_api_call
from .services.kinesis import patched_kinesis_api_call
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/dogpile_cache/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from wrapt import wrap_function_wrapper as _w

from ddtrace.internal.schema import schematize_service_name
from ddtrace._trace.pin import _DD_PIN_NAME
from ddtrace._trace.pin import _DD_PIN_PROXY_NAME
from ddtrace.internal.schema import schematize_service_name
from ddtrace.trace import Pin

from .lock import _wrap_lock_ctor
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/httplib/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from ddtrace.internal.schema import schematize_url_operation
from ddtrace.internal.schema.span_attribute_schema import SpanDirection
from ddtrace.internal.utils.formats import asbool
from ddtrace.trace import Pin
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.settings.asm import config as asm_config
from ddtrace.trace import Pin


span_name = "http.client.request"
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/httpx/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from ddtrace.internal.utils.formats import asbool
from ddtrace.internal.utils.version import parse_version
from ddtrace.internal.utils.wrappers import unwrap as _u
from ddtrace.trace import Pin
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.trace import Pin


HTTPX_VERSION = parse_version(httpx.__version__)
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/kafka/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
from ddtrace.internal.utils import set_argument_value
from ddtrace.internal.utils.formats import asbool
from ddtrace.internal.utils.version import parse_version
from ddtrace.trace import Pin
from ddtrace.propagation.http import HTTPPropagator as Propagator
from ddtrace.trace import Pin


_Producer = confluent_kafka.Producer
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/kombu/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from ddtrace.internal.utils import get_argument_value
from ddtrace.internal.utils.formats import asbool
from ddtrace.internal.utils.wrappers import unwrap
from ddtrace.trace import Pin
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.trace import Pin

from .constants import DEFAULT_SERVICE
from .utils import HEADER_POS
Expand Down
4 changes: 2 additions & 2 deletions ddtrace/contrib/internal/pymemcache/patch.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import pymemcache
import pymemcache.client.hash

from ddtrace.ext import memcached as memcachedx
from ddtrace.internal.schema import schematize_service_name
from ddtrace._trace.pin import _DD_PIN_NAME
from ddtrace._trace.pin import _DD_PIN_PROXY_NAME
from ddtrace._trace.pin import Pin
from ddtrace.ext import memcached as memcachedx
from ddtrace.internal.schema import schematize_service_name

from .client import WrappedClient
from .client import WrappedHashClient
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/requests/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from ddtrace.contrib.trace_utils import unwrap as _u
from ddtrace.internal.schema import schematize_service_name
from ddtrace.internal.utils.formats import asbool
from ddtrace.trace import Pin
from ddtrace.settings.asm import config as asm_config
from ddtrace.trace import Pin

from .connection import _wrap_send

Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/sqlite3/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from ddtrace.internal.schema import schematize_database_operation
from ddtrace.internal.schema import schematize_service_name
from ddtrace.internal.utils.formats import asbool
from ddtrace.trace import Pin
from ddtrace.settings.asm import config as asm_config
from ddtrace.trace import Pin


# Original connect method
Expand Down
2 changes: 1 addition & 1 deletion ddtrace/contrib/internal/urllib3/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from ddtrace.internal.utils import get_argument_value
from ddtrace.internal.utils.formats import asbool
from ddtrace.internal.utils.wrappers import unwrap as _u
from ddtrace.trace import Pin
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.settings.asm import config as asm_config
from ddtrace.trace import Pin


# Ports which, if set, will not be used in hostnames/service names
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/httpx/test_httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from ddtrace.contrib.httpx.patch import HTTPX_VERSION
from ddtrace.contrib.httpx.patch import patch
from ddtrace.contrib.httpx.patch import unpatch
from ddtrace.trace import Pin
from ddtrace.settings.http import HttpConfig
from ddtrace.trace import Pin
from tests.utils import flaky
from tests.utils import override_config
from tests.utils import override_http_config
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/httpx/test_httpx_pre_0_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from ddtrace.contrib.httpx.patch import HTTPX_VERSION
from ddtrace.contrib.httpx.patch import patch
from ddtrace.contrib.httpx.patch import unpatch
from ddtrace.trace import Pin
from ddtrace.settings.http import HttpConfig
from ddtrace.trace import Pin
from tests.utils import override_config
from tests.utils import override_http_config

Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/kafka/test_kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
from ddtrace.contrib.kafka.patch import TracedConsumer
from ddtrace.contrib.kafka.patch import patch
from ddtrace.contrib.kafka.patch import unpatch
from ddtrace.trace import TraceFilter
import ddtrace.internal.datastreams # noqa: F401 - used as part of mock patching
from ddtrace.internal.datastreams.processor import PROPAGATION_KEY_BASE_64
from ddtrace.internal.datastreams.processor import ConsumerPartitionKey
from ddtrace.internal.datastreams.processor import DataStreamsCtx
from ddtrace.internal.datastreams.processor import PartitionKey
from ddtrace.internal.utils.retry import fibonacci_backoff_with_jitter
from ddtrace.trace import TraceFilter
from tests.contrib.config import KAFKA_CONFIG
from tests.datastreams.test_public_api import MockedTracer
from tests.utils import DummyTracer
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/openai/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from ddtrace import Pin
from ddtrace import patch
from ddtrace.contrib.openai.patch import unpatch
from ddtrace.trace import TraceFilter
from ddtrace.llmobs import LLMObs
from ddtrace.trace import TraceFilter
from tests.utils import DummyTracer
from tests.utils import DummyWriter
from tests.utils import override_config
Expand Down
2 changes: 1 addition & 1 deletion tests/contrib/urllib3/test_urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from ddtrace.contrib.urllib3 import unpatch
from ddtrace.ext import http
from ddtrace.internal.schema import DEFAULT_SPAN_SERVICE_NAME
from ddtrace.trace import Pin
from ddtrace.settings.asm import config as asm_config
from ddtrace.trace import Pin
from tests.contrib.config import HTTPBIN_CONFIG
from tests.opentracer.utils import init_tracer
from tests.utils import TracerTestCase
Expand Down
2 changes: 1 addition & 1 deletion tests/tracer/runtime/test_tag_collectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def test_tracer_tags_config():
def test_tracer_tags_service_from_code():
"""Ensure we collect the expected tags for the TracerTagCollector"""
import ddtrace
from ddtrace.trace import TraceFilter
from ddtrace.internal.runtime import tag_collectors
from ddtrace.trace import TraceFilter
from tests.conftest import DEFAULT_DDTRACE_SUBPROCESS_TEST_SERVICE_NAME

class DropFilter(TraceFilter):
Expand Down
2 changes: 1 addition & 1 deletion tests/tracer/test_instance_config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from unittest import TestCase

from ddtrace import config
from ddtrace.trace import Pin
from ddtrace.settings import IntegrationConfig
from ddtrace.trace import Pin


class InstanceConfigTestCase(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/webclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import requests

from ddtrace._trace.context import Context
from ddtrace.trace import TraceFilter
from ddtrace.internal.utils.retry import retry
from ddtrace.propagation.http import HTTPPropagator
from ddtrace.trace import TraceFilter


class Client(object):
Expand Down

0 comments on commit 6eeb373

Please sign in to comment.