databricks-sdk 0.39.0__py3-none-any.whl → 0.41.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of databricks-sdk might be problematic. Click here for more details.

@@ -381,8 +381,9 @@ class GenieMessage:
381
381
  status: Optional[MessageStatus] = None
382
382
  """MesssageStatus. The possible values are: * `FETCHING_METADATA`: Fetching metadata from the data
383
383
  sources. * `FILTERING_CONTEXT`: Running smart context step to determine relevant context. *
384
- `ASKING_AI`: Waiting for the LLM to respond to the users question. * `EXECUTING_QUERY`:
385
- Executing AI provided SQL query. Get the SQL query result by calling
384
+ `ASKING_AI`: Waiting for the LLM to respond to the users question. * `PENDING_WAREHOUSE`:
385
+ Waiting for warehouse before the SQL query can start executing. * `EXECUTING_QUERY`: Executing
386
+ AI provided SQL query. Get the SQL query result by calling
386
387
  [getMessageQueryResult](:method:genie/getMessageQueryResult) API. **Important: The message
387
388
  status will stay in the `EXECUTING_QUERY` until a client calls
388
389
  [getMessageQueryResult](:method:genie/getMessageQueryResult)**. * `FAILED`: Generating a
@@ -678,8 +679,9 @@ class MessageErrorType(Enum):
678
679
  class MessageStatus(Enum):
679
680
  """MesssageStatus. The possible values are: * `FETCHING_METADATA`: Fetching metadata from the data
680
681
  sources. * `FILTERING_CONTEXT`: Running smart context step to determine relevant context. *
681
- `ASKING_AI`: Waiting for the LLM to respond to the users question. * `EXECUTING_QUERY`:
682
- Executing AI provided SQL query. Get the SQL query result by calling
682
+ `ASKING_AI`: Waiting for the LLM to respond to the users question. * `PENDING_WAREHOUSE`:
683
+ Waiting for warehouse before the SQL query can start executing. * `EXECUTING_QUERY`: Executing
684
+ AI provided SQL query. Get the SQL query result by calling
683
685
  [getMessageQueryResult](:method:genie/getMessageQueryResult) API. **Important: The message
684
686
  status will stay in the `EXECUTING_QUERY` until a client calls
685
687
  [getMessageQueryResult](:method:genie/getMessageQueryResult)**. * `FAILED`: Generating a
@@ -696,6 +698,7 @@ class MessageStatus(Enum):
696
698
  FAILED = 'FAILED'
697
699
  FETCHING_METADATA = 'FETCHING_METADATA'
698
700
  FILTERING_CONTEXT = 'FILTERING_CONTEXT'
701
+ PENDING_WAREHOUSE = 'PENDING_WAREHOUSE'
699
702
  QUERY_RESULT_EXPIRED = 'QUERY_RESULT_EXPIRED'
700
703
  SUBMITTED = 'SUBMITTED'
701
704
 
@@ -711,12 +714,18 @@ class MigrateDashboardRequest:
711
714
  parent_path: Optional[str] = None
712
715
  """The workspace path of the folder to contain the migrated Lakeview dashboard."""
713
716
 
717
+ update_parameter_syntax: Optional[bool] = None
718
+ """Flag to indicate if mustache parameter syntax ({{ param }}) should be auto-updated to named
719
+ syntax (:param) when converting datasets in the dashboard."""
720
+
714
721
  def as_dict(self) -> dict:
715
722
  """Serializes the MigrateDashboardRequest into a dictionary suitable for use as a JSON request body."""
716
723
  body = {}
717
724
  if self.display_name is not None: body['display_name'] = self.display_name
718
725
  if self.parent_path is not None: body['parent_path'] = self.parent_path
719
726
  if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id
727
+ if self.update_parameter_syntax is not None:
728
+ body['update_parameter_syntax'] = self.update_parameter_syntax
720
729
  return body
721
730
 
722
731
  def as_shallow_dict(self) -> dict:
@@ -725,6 +734,8 @@ class MigrateDashboardRequest:
725
734
  if self.display_name is not None: body['display_name'] = self.display_name
726
735
  if self.parent_path is not None: body['parent_path'] = self.parent_path
727
736
  if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id
737
+ if self.update_parameter_syntax is not None:
738
+ body['update_parameter_syntax'] = self.update_parameter_syntax
728
739
  return body
729
740
 
730
741
  @classmethod
@@ -732,7 +743,8 @@ class MigrateDashboardRequest:
732
743
  """Deserializes the MigrateDashboardRequest from a dictionary."""
733
744
  return cls(display_name=d.get('display_name', None),
734
745
  parent_path=d.get('parent_path', None),
735
- source_dashboard_id=d.get('source_dashboard_id', None))
746
+ source_dashboard_id=d.get('source_dashboard_id', None),
747
+ update_parameter_syntax=d.get('update_parameter_syntax', None))
736
748
 
737
749
 
738
750
  @dataclass
@@ -1759,7 +1771,8 @@ class LakeviewAPI:
1759
1771
  source_dashboard_id: str,
1760
1772
  *,
1761
1773
  display_name: Optional[str] = None,
1762
- parent_path: Optional[str] = None) -> Dashboard:
1774
+ parent_path: Optional[str] = None,
1775
+ update_parameter_syntax: Optional[bool] = None) -> Dashboard:
1763
1776
  """Migrate dashboard.
1764
1777
 
1765
1778
  Migrates a classic SQL dashboard to Lakeview.
@@ -1770,6 +1783,9 @@ class LakeviewAPI:
1770
1783
  Display name for the new Lakeview dashboard.
1771
1784
  :param parent_path: str (optional)
1772
1785
  The workspace path of the folder to contain the migrated Lakeview dashboard.
1786
+ :param update_parameter_syntax: bool (optional)
1787
+ Flag to indicate if mustache parameter syntax ({{ param }}) should be auto-updated to named syntax
1788
+ (:param) when converting datasets in the dashboard.
1773
1789
 
1774
1790
  :returns: :class:`Dashboard`
1775
1791
  """
@@ -1777,6 +1793,7 @@ class LakeviewAPI:
1777
1793
  if display_name is not None: body['display_name'] = display_name
1778
1794
  if parent_path is not None: body['parent_path'] = parent_path
1779
1795
  if source_dashboard_id is not None: body['source_dashboard_id'] = source_dashboard_id
1796
+ if update_parameter_syntax is not None: body['update_parameter_syntax'] = update_parameter_syntax
1780
1797
  headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
1781
1798
 
1782
1799
  res = self._api.do('POST', '/api/2.0/lakeview/dashboards/migrate', body=body, headers=headers)
@@ -925,9 +925,12 @@ class FilesAPI:
925
925
  /Volumes/<catalog_name>/<schema_name>/<volume_name>/<path_to_file>.
926
926
 
927
927
  The Files API has two distinct endpoints, one for working with files (`/fs/files`) and another one for
928
- working with directories (`/fs/directories`). Both endpoints, use the standard HTTP methods GET, HEAD,
929
- PUT, and DELETE to manage files and directories specified using their URI path. The path is always
930
- absolute.
928
+ working with directories (`/fs/directories`). Both endpoints use the standard HTTP methods GET, HEAD, PUT,
929
+ and DELETE to manage files and directories specified using their URI path. The path is always absolute.
930
+
931
+ Some Files API client features are currently experimental. To enable them, set
932
+ `enable_experimental_files_api_client = True` in your configuration profile or use the environment
933
+ variable `DATABRICKS_ENABLE_EXPERIMENTAL_FILES_API_CLIENT=True`.
931
934
 
932
935
  [Unity Catalog volumes]: https://docs.databricks.com/en/connect/unity-catalog/volumes.html"""
933
936
 
@@ -106,6 +106,58 @@ class AccessControlResponse:
106
106
  user_name=d.get('user_name', None))
107
107
 
108
108
 
109
+ @dataclass
110
+ class Actor:
111
+ """represents an identity trying to access a resource - user or a service principal group can be a
112
+ principal of a permission set assignment but an actor is always a user or a service principal"""
113
+
114
+ actor_id: Optional[int] = None
115
+
116
+ def as_dict(self) -> dict:
117
+ """Serializes the Actor into a dictionary suitable for use as a JSON request body."""
118
+ body = {}
119
+ if self.actor_id is not None: body['actor_id'] = self.actor_id
120
+ return body
121
+
122
+ def as_shallow_dict(self) -> dict:
123
+ """Serializes the Actor into a shallow dictionary of its immediate attributes."""
124
+ body = {}
125
+ if self.actor_id is not None: body['actor_id'] = self.actor_id
126
+ return body
127
+
128
+ @classmethod
129
+ def from_dict(cls, d: Dict[str, any]) -> Actor:
130
+ """Deserializes the Actor from a dictionary."""
131
+ return cls(actor_id=d.get('actor_id', None))
132
+
133
+
134
+ @dataclass
135
+ class CheckPolicyResponse:
136
+ consistency_token: ConsistencyToken
137
+
138
+ is_permitted: Optional[bool] = None
139
+
140
+ def as_dict(self) -> dict:
141
+ """Serializes the CheckPolicyResponse into a dictionary suitable for use as a JSON request body."""
142
+ body = {}
143
+ if self.consistency_token: body['consistency_token'] = self.consistency_token.as_dict()
144
+ if self.is_permitted is not None: body['is_permitted'] = self.is_permitted
145
+ return body
146
+
147
+ def as_shallow_dict(self) -> dict:
148
+ """Serializes the CheckPolicyResponse into a shallow dictionary of its immediate attributes."""
149
+ body = {}
150
+ if self.consistency_token: body['consistency_token'] = self.consistency_token
151
+ if self.is_permitted is not None: body['is_permitted'] = self.is_permitted
152
+ return body
153
+
154
+ @classmethod
155
+ def from_dict(cls, d: Dict[str, any]) -> CheckPolicyResponse:
156
+ """Deserializes the CheckPolicyResponse from a dictionary."""
157
+ return cls(consistency_token=_from_dict(d, 'consistency_token', ConsistencyToken),
158
+ is_permitted=d.get('is_permitted', None))
159
+
160
+
109
161
  @dataclass
110
162
  class ComplexValue:
111
163
  display: Optional[str] = None
@@ -148,6 +200,28 @@ class ComplexValue:
148
200
  value=d.get('value', None))
149
201
 
150
202
 
203
+ @dataclass
204
+ class ConsistencyToken:
205
+ value: str
206
+
207
+ def as_dict(self) -> dict:
208
+ """Serializes the ConsistencyToken into a dictionary suitable for use as a JSON request body."""
209
+ body = {}
210
+ if self.value is not None: body['value'] = self.value
211
+ return body
212
+
213
+ def as_shallow_dict(self) -> dict:
214
+ """Serializes the ConsistencyToken into a shallow dictionary of its immediate attributes."""
215
+ body = {}
216
+ if self.value is not None: body['value'] = self.value
217
+ return body
218
+
219
+ @classmethod
220
+ def from_dict(cls, d: Dict[str, any]) -> ConsistencyToken:
221
+ """Deserializes the ConsistencyToken from a dictionary."""
222
+ return cls(value=d.get('value', None))
223
+
224
+
151
225
  @dataclass
152
226
  class DeleteResponse:
153
227
 
@@ -1219,6 +1293,49 @@ class PrincipalOutput:
1219
1293
  user_name=d.get('user_name', None))
1220
1294
 
1221
1295
 
1296
+ class RequestAuthzIdentity(Enum):
1297
+ """Defines the identity to be used for authZ of the request on the server side. See one pager for
1298
+ for more information: http://go/acl/service-identity"""
1299
+
1300
+ REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY = 'REQUEST_AUTHZ_IDENTITY_SERVICE_IDENTITY'
1301
+ REQUEST_AUTHZ_IDENTITY_USER_CONTEXT = 'REQUEST_AUTHZ_IDENTITY_USER_CONTEXT'
1302
+
1303
+
1304
+ @dataclass
1305
+ class ResourceInfo:
1306
+ id: str
1307
+ """Id of the current resource."""
1308
+
1309
+ legacy_acl_path: Optional[str] = None
1310
+ """The legacy acl path of the current resource."""
1311
+
1312
+ parent_resource_info: Optional[ResourceInfo] = None
1313
+ """Parent resource info for the current resource. The parent may have another parent."""
1314
+
1315
+ def as_dict(self) -> dict:
1316
+ """Serializes the ResourceInfo into a dictionary suitable for use as a JSON request body."""
1317
+ body = {}
1318
+ if self.id is not None: body['id'] = self.id
1319
+ if self.legacy_acl_path is not None: body['legacy_acl_path'] = self.legacy_acl_path
1320
+ if self.parent_resource_info: body['parent_resource_info'] = self.parent_resource_info.as_dict()
1321
+ return body
1322
+
1323
+ def as_shallow_dict(self) -> dict:
1324
+ """Serializes the ResourceInfo into a shallow dictionary of its immediate attributes."""
1325
+ body = {}
1326
+ if self.id is not None: body['id'] = self.id
1327
+ if self.legacy_acl_path is not None: body['legacy_acl_path'] = self.legacy_acl_path
1328
+ if self.parent_resource_info: body['parent_resource_info'] = self.parent_resource_info
1329
+ return body
1330
+
1331
+ @classmethod
1332
+ def from_dict(cls, d: Dict[str, any]) -> ResourceInfo:
1333
+ """Deserializes the ResourceInfo from a dictionary."""
1334
+ return cls(id=d.get('id', None),
1335
+ legacy_acl_path=d.get('legacy_acl_path', None),
1336
+ parent_resource_info=_from_dict(d, 'parent_resource_info', ResourceInfo))
1337
+
1338
+
1222
1339
  @dataclass
1223
1340
  class ResourceMeta:
1224
1341
  resource_type: Optional[str] = None
@@ -1622,6 +1739,47 @@ class WorkspacePermissions:
1622
1739
  return cls(permissions=_repeated_dict(d, 'permissions', PermissionOutput))
1623
1740
 
1624
1741
 
1742
+ class AccessControlAPI:
1743
+ """Rule based Access Control for Databricks Resources."""
1744
+
1745
+ def __init__(self, api_client):
1746
+ self._api = api_client
1747
+
1748
+ def check_policy(self,
1749
+ actor: Actor,
1750
+ permission: str,
1751
+ resource: str,
1752
+ consistency_token: ConsistencyToken,
1753
+ authz_identity: RequestAuthzIdentity,
1754
+ *,
1755
+ resource_info: Optional[ResourceInfo] = None) -> CheckPolicyResponse:
1756
+ """Check access policy to a resource.
1757
+
1758
+ :param actor: :class:`Actor`
1759
+ :param permission: str
1760
+ :param resource: str
1761
+ Ex: (servicePrincipal/use, accounts/<account-id>/servicePrincipals/<sp-id>) Ex:
1762
+ (servicePrincipal.ruleSet/update, accounts/<account-id>/servicePrincipals/<sp-id>/ruleSets/default)
1763
+ :param consistency_token: :class:`ConsistencyToken`
1764
+ :param authz_identity: :class:`RequestAuthzIdentity`
1765
+ :param resource_info: :class:`ResourceInfo` (optional)
1766
+
1767
+ :returns: :class:`CheckPolicyResponse`
1768
+ """
1769
+
1770
+ query = {}
1771
+ if actor is not None: query['actor'] = actor.as_dict()
1772
+ if authz_identity is not None: query['authz_identity'] = authz_identity.value
1773
+ if consistency_token is not None: query['consistency_token'] = consistency_token.as_dict()
1774
+ if permission is not None: query['permission'] = permission
1775
+ if resource is not None: query['resource'] = resource
1776
+ if resource_info is not None: query['resource_info'] = resource_info.as_dict()
1777
+ headers = {'Accept': 'application/json', }
1778
+
1779
+ res = self._api.do('GET', '/api/2.0/access-control/check-policy-v2', query=query, headers=headers)
1780
+ return CheckPolicyResponse.from_dict(res)
1781
+
1782
+
1625
1783
  class AccountAccessControlAPI:
1626
1784
  """These APIs manage access rules on resources in an account. Currently, only grant rules are supported. A
1627
1785
  grant rule specifies a role assigned to a set of principals. A list of rules attached to a resource is