Skip to content

Commit 0514a9e

Browse files
P403n1x87chojomok
authored andcommitted
refactor: direct constants import (#12973)
We refactor some imports from ddtrace.constants to import the module directly instead of grabbing it from ddtrace. This removes some circular import paths from static code analysis. ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent 7035a62 commit 0514a9e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: ddtrace/appsec/_api_security/api_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import time
66
from typing import Optional
77

8-
from ddtrace import constants
98
from ddtrace._trace._limits import MAX_SPAN_META_VALUE_LEN
109
from ddtrace.appsec._constants import API_SECURITY
1110
from ddtrace.appsec._constants import SPAN_DATA_NAMES
11+
import ddtrace.constants as constants
1212
from ddtrace.internal.logger import get_logger
1313
from ddtrace.internal.service import Service
1414
from ddtrace.settings.asm import config as asm_config

Diff for: ddtrace/appsec/_trace_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from typing import Optional
22

3-
from ddtrace import constants
43
from ddtrace.appsec import _asm_request_context
54
from ddtrace.appsec._asm_request_context import call_waf_callback
65
from ddtrace.appsec._asm_request_context import get_blocked
@@ -9,6 +8,7 @@
98
from ddtrace.appsec._constants import LOGIN_EVENTS_MODE
109
from ddtrace.appsec._constants import WAF_ACTIONS
1110
from ddtrace.appsec._utils import _hash_user_id
11+
import ddtrace.constants as constants
1212
from ddtrace.contrib.internal.trace_utils import set_user
1313
from ddtrace.ext import SpanTypes
1414
from ddtrace.ext import user

0 commit comments

Comments
 (0)