fix(logging): suppress per-request belief scope spam in API client
This commit is contained in:
@@ -203,7 +203,6 @@ class APIClient:
|
|||||||
# @PRE: APIClient is initialized and authenticated or can be authenticated.
|
# @PRE: APIClient is initialized and authenticated or can be authenticated.
|
||||||
# @POST: Returns headers including auth tokens.
|
# @POST: Returns headers including auth tokens.
|
||||||
def headers(self) -> Dict[str, str]:
|
def headers(self) -> Dict[str, str]:
|
||||||
with belief_scope("headers"):
|
|
||||||
if not self._authenticated:
|
if not self._authenticated:
|
||||||
self.authenticate()
|
self.authenticate()
|
||||||
return {
|
return {
|
||||||
@@ -225,7 +224,6 @@ class APIClient:
|
|||||||
# @RETURN: `requests.Response` если `raw_response=True`, иначе `dict`.
|
# @RETURN: `requests.Response` если `raw_response=True`, иначе `dict`.
|
||||||
# @THROW: SupersetAPIError, NetworkError и их подклассы.
|
# @THROW: SupersetAPIError, NetworkError и их подклассы.
|
||||||
def request(self, method: str, endpoint: str, headers: Optional[Dict] = None, raw_response: bool = False, **kwargs) -> Union[requests.Response, Dict[str, Any]]:
|
def request(self, method: str, endpoint: str, headers: Optional[Dict] = None, raw_response: bool = False, **kwargs) -> Union[requests.Response, Dict[str, Any]]:
|
||||||
with belief_scope("request"):
|
|
||||||
full_url = f"{self.base_url}{endpoint}"
|
full_url = f"{self.base_url}{endpoint}"
|
||||||
_headers = self.headers.copy()
|
_headers = self.headers.copy()
|
||||||
if headers:
|
if headers:
|
||||||
|
|||||||
Reference in New Issue
Block a user