Skip to content

Commit efbaa2e

Browse files
Remove non-actionable warning messages in error construction. (#970)
## What changes are proposed in this pull request? This PR removes warning messages that are not actionable by users. ## How is this tested? Unit and integration tests. NO_CHANGELOG=true
1 parent ad0e9f1 commit efbaa2e

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

databricks/sdk/errors/base.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import re
2-
import warnings
32
from dataclasses import dataclass
43
from typing import Any, Dict, List, Optional
54

@@ -62,31 +61,6 @@ def __init__(
6261
:param details:
6362
:param kwargs:
6463
"""
65-
# SCIM-specific parameters are deprecated.
66-
if detail:
67-
warnings.warn(
68-
"The 'detail' parameter of DatabricksError is deprecated and will be removed in a future version."
69-
)
70-
if scimType:
71-
warnings.warn(
72-
"The 'scimType' parameter of DatabricksError is deprecated and will be removed in a future version."
73-
)
74-
if status:
75-
warnings.warn(
76-
"The 'status' parameter of DatabricksError is deprecated and will be removed in a future version."
77-
)
78-
79-
# API 1.2-specific parameters are deprecated.
80-
if error:
81-
warnings.warn(
82-
"The 'error' parameter of DatabricksError is deprecated and will be removed in a future version."
83-
)
84-
85-
# Retry-after is deprecated.
86-
if retry_after_secs:
87-
warnings.warn(
88-
"The 'retry_after_secs' parameter of DatabricksError is deprecated and will be removed in a future version."
89-
)
9064

9165
if detail:
9266
# Handle SCIM error message details
@@ -114,12 +88,9 @@ def __init__(
11488
self.details.append(ErrorDetail.from_dict(d))
11589

11690
def get_error_info(self) -> List[ErrorDetail]:
117-
return self._get_details_by_type(errdetails._ERROR_INFO_TYPE)
118-
119-
def _get_details_by_type(self, error_type) -> List[ErrorDetail]:
12091
if self.details is None:
12192
return []
122-
return [detail for detail in self.details if detail.type == error_type]
93+
return [detail for detail in self.details if detail.type == errdetails._ERROR_INFO_TYPE]
12394

12495
def get_error_details(self) -> errdetails.ErrorDetails:
12596
return self._error_details

0 commit comments

Comments
 (0)