|
1 | 1 | import re |
2 | | -import warnings |
3 | 2 | from dataclasses import dataclass |
4 | 3 | from typing import Any, Dict, List, Optional |
5 | 4 |
|
@@ -62,31 +61,6 @@ def __init__( |
62 | 61 | :param details: |
63 | 62 | :param kwargs: |
64 | 63 | """ |
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 | | - ) |
90 | 64 |
|
91 | 65 | if detail: |
92 | 66 | # Handle SCIM error message details |
@@ -114,12 +88,9 @@ def __init__( |
114 | 88 | self.details.append(ErrorDetail.from_dict(d)) |
115 | 89 |
|
116 | 90 | 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]: |
120 | 91 | if self.details is None: |
121 | 92 | 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] |
123 | 94 |
|
124 | 95 | def get_error_details(self) -> errdetails.ErrorDetails: |
125 | 96 | return self._error_details |
|
0 commit comments