databricks-sdk 0.63.0__py3-none-any.whl → 0.65.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.

@@ -1827,59 +1827,32 @@ class SecurablePropertiesKvPairs:
1827
1827
 
1828
1828
  @dataclass
1829
1829
  class Share:
1830
- comment: Optional[str] = None
1831
- """The comment of the share."""
1832
-
1833
- display_name: Optional[str] = None
1834
- """The display name of the share. If defined, it will be shown in the UI."""
1835
-
1836
1830
  id: Optional[str] = None
1837
1831
 
1838
1832
  name: Optional[str] = None
1839
1833
 
1840
- tags: Optional[List[catalog.TagKeyValue]] = None
1841
- """The tags of the share."""
1842
-
1843
1834
  def as_dict(self) -> dict:
1844
1835
  """Serializes the Share into a dictionary suitable for use as a JSON request body."""
1845
1836
  body = {}
1846
- if self.comment is not None:
1847
- body["comment"] = self.comment
1848
- if self.display_name is not None:
1849
- body["display_name"] = self.display_name
1850
1837
  if self.id is not None:
1851
1838
  body["id"] = self.id
1852
1839
  if self.name is not None:
1853
1840
  body["name"] = self.name
1854
- if self.tags:
1855
- body["tags"] = [v.as_dict() for v in self.tags]
1856
1841
  return body
1857
1842
 
1858
1843
  def as_shallow_dict(self) -> dict:
1859
1844
  """Serializes the Share into a shallow dictionary of its immediate attributes."""
1860
1845
  body = {}
1861
- if self.comment is not None:
1862
- body["comment"] = self.comment
1863
- if self.display_name is not None:
1864
- body["display_name"] = self.display_name
1865
1846
  if self.id is not None:
1866
1847
  body["id"] = self.id
1867
1848
  if self.name is not None:
1868
1849
  body["name"] = self.name
1869
- if self.tags:
1870
- body["tags"] = self.tags
1871
1850
  return body
1872
1851
 
1873
1852
  @classmethod
1874
1853
  def from_dict(cls, d: Dict[str, Any]) -> Share:
1875
1854
  """Deserializes the Share from a dictionary."""
1876
- return cls(
1877
- comment=d.get("comment", None),
1878
- display_name=d.get("display_name", None),
1879
- id=d.get("id", None),
1880
- name=d.get("name", None),
1881
- tags=_repeated_dict(d, "tags", catalog.TagKeyValue),
1882
- )
1855
+ return cls(id=d.get("id", None), name=d.get("name", None))
1883
1856
 
1884
1857
 
1885
1858
  @dataclass
@@ -646,6 +646,10 @@ class AlertV2:
646
646
  display_name: Optional[str] = None
647
647
  """The display name of the alert."""
648
648
 
649
+ effective_run_as: Optional[AlertV2RunAs] = None
650
+ """The actual identity that will be used to execute the alert. This is an output-only field that
651
+ shows the resolved run-as identity after applying permissions and defaults."""
652
+
649
653
  evaluation: Optional[AlertV2Evaluation] = None
650
654
 
651
655
  id: Optional[str] = None
@@ -664,10 +668,18 @@ class AlertV2:
664
668
  query_text: Optional[str] = None
665
669
  """Text of the query to be run."""
666
670
 
671
+ run_as: Optional[AlertV2RunAs] = None
672
+ """Specifies the identity that will be used to run the alert. This field allows you to configure
673
+ alerts to run as a specific user or service principal. - For user identity: Set `user_name` to
674
+ the email of an active workspace user. Users can only set this to their own email. - For service
675
+ principal: Set `service_principal_name` to the application ID. Requires the
676
+ `servicePrincipal/user` role. If not specified, the alert will run as the request user."""
677
+
667
678
  run_as_user_name: Optional[str] = None
668
679
  """The run as username or application ID of service principal. On Create and Update, this field can
669
680
  be set to application ID of an active service principal. Setting this field requires the
670
- servicePrincipal/user role."""
681
+ servicePrincipal/user role. Deprecated: Use `run_as` field instead. This field will be removed
682
+ in a future release."""
671
683
 
672
684
  schedule: Optional[CronSchedule] = None
673
685
 
@@ -688,6 +700,8 @@ class AlertV2:
688
700
  body["custom_summary"] = self.custom_summary
689
701
  if self.display_name is not None:
690
702
  body["display_name"] = self.display_name
703
+ if self.effective_run_as:
704
+ body["effective_run_as"] = self.effective_run_as.as_dict()
691
705
  if self.evaluation:
692
706
  body["evaluation"] = self.evaluation.as_dict()
693
707
  if self.id is not None:
@@ -700,6 +714,8 @@ class AlertV2:
700
714
  body["parent_path"] = self.parent_path
701
715
  if self.query_text is not None:
702
716
  body["query_text"] = self.query_text
717
+ if self.run_as:
718
+ body["run_as"] = self.run_as.as_dict()
703
719
  if self.run_as_user_name is not None:
704
720
  body["run_as_user_name"] = self.run_as_user_name
705
721
  if self.schedule:
@@ -721,6 +737,8 @@ class AlertV2:
721
737
  body["custom_summary"] = self.custom_summary
722
738
  if self.display_name is not None:
723
739
  body["display_name"] = self.display_name
740
+ if self.effective_run_as:
741
+ body["effective_run_as"] = self.effective_run_as
724
742
  if self.evaluation:
725
743
  body["evaluation"] = self.evaluation
726
744
  if self.id is not None:
@@ -733,6 +751,8 @@ class AlertV2:
733
751
  body["parent_path"] = self.parent_path
734
752
  if self.query_text is not None:
735
753
  body["query_text"] = self.query_text
754
+ if self.run_as:
755
+ body["run_as"] = self.run_as
736
756
  if self.run_as_user_name is not None:
737
757
  body["run_as_user_name"] = self.run_as_user_name
738
758
  if self.schedule:
@@ -751,12 +771,14 @@ class AlertV2:
751
771
  custom_description=d.get("custom_description", None),
752
772
  custom_summary=d.get("custom_summary", None),
753
773
  display_name=d.get("display_name", None),
774
+ effective_run_as=_from_dict(d, "effective_run_as", AlertV2RunAs),
754
775
  evaluation=_from_dict(d, "evaluation", AlertV2Evaluation),
755
776
  id=d.get("id", None),
756
777
  lifecycle_state=_enum(d, "lifecycle_state", LifecycleState),
757
778
  owner_user_name=d.get("owner_user_name", None),
758
779
  parent_path=d.get("parent_path", None),
759
780
  query_text=d.get("query_text", None),
781
+ run_as=_from_dict(d, "run_as", AlertV2RunAs),
760
782
  run_as_user_name=d.get("run_as_user_name", None),
761
783
  schedule=_from_dict(d, "schedule", CronSchedule),
762
784
  update_time=d.get("update_time", None),
@@ -992,6 +1014,39 @@ class AlertV2OperandValue:
992
1014
  )
993
1015
 
994
1016
 
1017
+ @dataclass
1018
+ class AlertV2RunAs:
1019
+ service_principal_name: Optional[str] = None
1020
+ """Application ID of an active service principal. Setting this field requires the
1021
+ `servicePrincipal/user` role."""
1022
+
1023
+ user_name: Optional[str] = None
1024
+ """The email of an active workspace user. Can only set this field to their own email."""
1025
+
1026
+ def as_dict(self) -> dict:
1027
+ """Serializes the AlertV2RunAs into a dictionary suitable for use as a JSON request body."""
1028
+ body = {}
1029
+ if self.service_principal_name is not None:
1030
+ body["service_principal_name"] = self.service_principal_name
1031
+ if self.user_name is not None:
1032
+ body["user_name"] = self.user_name
1033
+ return body
1034
+
1035
+ def as_shallow_dict(self) -> dict:
1036
+ """Serializes the AlertV2RunAs into a shallow dictionary of its immediate attributes."""
1037
+ body = {}
1038
+ if self.service_principal_name is not None:
1039
+ body["service_principal_name"] = self.service_principal_name
1040
+ if self.user_name is not None:
1041
+ body["user_name"] = self.user_name
1042
+ return body
1043
+
1044
+ @classmethod
1045
+ def from_dict(cls, d: Dict[str, Any]) -> AlertV2RunAs:
1046
+ """Deserializes the AlertV2RunAs from a dictionary."""
1047
+ return cls(service_principal_name=d.get("service_principal_name", None), user_name=d.get("user_name", None))
1048
+
1049
+
995
1050
  @dataclass
996
1051
  class AlertV2Subscription:
997
1052
  destination_id: Optional[str] = None
@@ -4723,6 +4778,9 @@ class QueryFilter:
4723
4778
 
4724
4779
  @dataclass
4725
4780
  class QueryInfo:
4781
+ cache_query_id: Optional[str] = None
4782
+ """The ID of the cached query if this result retrieved from cache"""
4783
+
4726
4784
  channel_used: Optional[ChannelInfo] = None
4727
4785
  """SQL Warehouse channel information at the time of query execution"""
4728
4786
 
@@ -4808,6 +4866,8 @@ class QueryInfo:
4808
4866
  def as_dict(self) -> dict:
4809
4867
  """Serializes the QueryInfo into a dictionary suitable for use as a JSON request body."""
4810
4868
  body = {}
4869
+ if self.cache_query_id is not None:
4870
+ body["cache_query_id"] = self.cache_query_id
4811
4871
  if self.channel_used:
4812
4872
  body["channel_used"] = self.channel_used.as_dict()
4813
4873
  if self.client_application is not None:
@@ -4861,6 +4921,8 @@ class QueryInfo:
4861
4921
  def as_shallow_dict(self) -> dict:
4862
4922
  """Serializes the QueryInfo into a shallow dictionary of its immediate attributes."""
4863
4923
  body = {}
4924
+ if self.cache_query_id is not None:
4925
+ body["cache_query_id"] = self.cache_query_id
4864
4926
  if self.channel_used:
4865
4927
  body["channel_used"] = self.channel_used
4866
4928
  if self.client_application is not None:
@@ -4915,6 +4977,7 @@ class QueryInfo:
4915
4977
  def from_dict(cls, d: Dict[str, Any]) -> QueryInfo:
4916
4978
  """Deserializes the QueryInfo from a dictionary."""
4917
4979
  return cls(
4980
+ cache_query_id=d.get("cache_query_id", None),
4918
4981
  channel_used=_from_dict(d, "channel_used", ChannelInfo),
4919
4982
  client_application=d.get("client_application", None),
4920
4983
  duration=d.get("duration", None),
@@ -0,0 +1,232 @@
1
+ # Code generated from OpenAPI specs by Databricks SDK Generator. DO NOT EDIT.
2
+
3
+ from __future__ import annotations
4
+
5
+ import logging
6
+ from dataclasses import dataclass
7
+ from typing import Any, Dict, Iterator, List, Optional
8
+
9
+ from ._internal import _repeated_dict
10
+
11
+ _LOG = logging.getLogger("databricks.sdk")
12
+
13
+
14
+ # all definitions in this file are in alphabetical order
15
+
16
+
17
+ @dataclass
18
+ class ListTagPoliciesResponse:
19
+ next_page_token: Optional[str] = None
20
+
21
+ tag_policies: Optional[List[TagPolicy]] = None
22
+
23
+ def as_dict(self) -> dict:
24
+ """Serializes the ListTagPoliciesResponse into a dictionary suitable for use as a JSON request body."""
25
+ body = {}
26
+ if self.next_page_token is not None:
27
+ body["next_page_token"] = self.next_page_token
28
+ if self.tag_policies:
29
+ body["tag_policies"] = [v.as_dict() for v in self.tag_policies]
30
+ return body
31
+
32
+ def as_shallow_dict(self) -> dict:
33
+ """Serializes the ListTagPoliciesResponse into a shallow dictionary of its immediate attributes."""
34
+ body = {}
35
+ if self.next_page_token is not None:
36
+ body["next_page_token"] = self.next_page_token
37
+ if self.tag_policies:
38
+ body["tag_policies"] = self.tag_policies
39
+ return body
40
+
41
+ @classmethod
42
+ def from_dict(cls, d: Dict[str, Any]) -> ListTagPoliciesResponse:
43
+ """Deserializes the ListTagPoliciesResponse from a dictionary."""
44
+ return cls(
45
+ next_page_token=d.get("next_page_token", None), tag_policies=_repeated_dict(d, "tag_policies", TagPolicy)
46
+ )
47
+
48
+
49
+ @dataclass
50
+ class TagPolicy:
51
+ tag_key: str
52
+
53
+ description: Optional[str] = None
54
+
55
+ id: Optional[str] = None
56
+
57
+ values: Optional[List[Value]] = None
58
+
59
+ def as_dict(self) -> dict:
60
+ """Serializes the TagPolicy into a dictionary suitable for use as a JSON request body."""
61
+ body = {}
62
+ if self.description is not None:
63
+ body["description"] = self.description
64
+ if self.id is not None:
65
+ body["id"] = self.id
66
+ if self.tag_key is not None:
67
+ body["tag_key"] = self.tag_key
68
+ if self.values:
69
+ body["values"] = [v.as_dict() for v in self.values]
70
+ return body
71
+
72
+ def as_shallow_dict(self) -> dict:
73
+ """Serializes the TagPolicy into a shallow dictionary of its immediate attributes."""
74
+ body = {}
75
+ if self.description is not None:
76
+ body["description"] = self.description
77
+ if self.id is not None:
78
+ body["id"] = self.id
79
+ if self.tag_key is not None:
80
+ body["tag_key"] = self.tag_key
81
+ if self.values:
82
+ body["values"] = self.values
83
+ return body
84
+
85
+ @classmethod
86
+ def from_dict(cls, d: Dict[str, Any]) -> TagPolicy:
87
+ """Deserializes the TagPolicy from a dictionary."""
88
+ return cls(
89
+ description=d.get("description", None),
90
+ id=d.get("id", None),
91
+ tag_key=d.get("tag_key", None),
92
+ values=_repeated_dict(d, "values", Value),
93
+ )
94
+
95
+
96
+ @dataclass
97
+ class Value:
98
+ name: str
99
+
100
+ def as_dict(self) -> dict:
101
+ """Serializes the Value into a dictionary suitable for use as a JSON request body."""
102
+ body = {}
103
+ if self.name is not None:
104
+ body["name"] = self.name
105
+ return body
106
+
107
+ def as_shallow_dict(self) -> dict:
108
+ """Serializes the Value into a shallow dictionary of its immediate attributes."""
109
+ body = {}
110
+ if self.name is not None:
111
+ body["name"] = self.name
112
+ return body
113
+
114
+ @classmethod
115
+ def from_dict(cls, d: Dict[str, Any]) -> Value:
116
+ """Deserializes the Value from a dictionary."""
117
+ return cls(name=d.get("name", None))
118
+
119
+
120
+ class TagPoliciesAPI:
121
+ """The Tag Policy API allows you to manage tag policies in Databricks."""
122
+
123
+ def __init__(self, api_client):
124
+ self._api = api_client
125
+
126
+ def create_tag_policy(self, tag_policy: TagPolicy) -> TagPolicy:
127
+ """Creates a new tag policy.
128
+
129
+ :param tag_policy: :class:`TagPolicy`
130
+
131
+ :returns: :class:`TagPolicy`
132
+ """
133
+ body = tag_policy.as_dict()
134
+ headers = {
135
+ "Accept": "application/json",
136
+ "Content-Type": "application/json",
137
+ }
138
+
139
+ res = self._api.do("POST", "/api/2.1/tag-policies", body=body, headers=headers)
140
+ return TagPolicy.from_dict(res)
141
+
142
+ def delete_tag_policy(self, tag_key: str):
143
+ """Deletes a tag policy by its key.
144
+
145
+ :param tag_key: str
146
+
147
+
148
+ """
149
+
150
+ headers = {
151
+ "Accept": "application/json",
152
+ }
153
+
154
+ self._api.do("DELETE", f"/api/2.1/tag-policies/{tag_key}", headers=headers)
155
+
156
+ def get_tag_policy(self, tag_key: str) -> TagPolicy:
157
+ """Gets a single tag policy by its key.
158
+
159
+ :param tag_key: str
160
+
161
+ :returns: :class:`TagPolicy`
162
+ """
163
+
164
+ headers = {
165
+ "Accept": "application/json",
166
+ }
167
+
168
+ res = self._api.do("GET", f"/api/2.1/tag-policies/{tag_key}", headers=headers)
169
+ return TagPolicy.from_dict(res)
170
+
171
+ def list_tag_policies(
172
+ self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
173
+ ) -> Iterator[TagPolicy]:
174
+ """Lists all tag policies in the account.
175
+
176
+ :param page_size: int (optional)
177
+ The maximum number of results to return in this request. Fewer results may be returned than
178
+ requested. If unspecified or set to 0, this defaults to 1000. The maximum value is 1000; values
179
+ above 1000 will be coerced down to 1000.
180
+ :param page_token: str (optional)
181
+ An optional page token received from a previous list tag policies call.
182
+
183
+ :returns: Iterator over :class:`TagPolicy`
184
+ """
185
+
186
+ query = {}
187
+ if page_size is not None:
188
+ query["page_size"] = page_size
189
+ if page_token is not None:
190
+ query["page_token"] = page_token
191
+ headers = {
192
+ "Accept": "application/json",
193
+ }
194
+
195
+ while True:
196
+ json = self._api.do("GET", "/api/2.1/tag-policies", query=query, headers=headers)
197
+ if "tag_policies" in json:
198
+ for v in json["tag_policies"]:
199
+ yield TagPolicy.from_dict(v)
200
+ if "next_page_token" not in json or not json["next_page_token"]:
201
+ return
202
+ query["page_token"] = json["next_page_token"]
203
+
204
+ def update_tag_policy(self, tag_key: str, tag_policy: TagPolicy, update_mask: str) -> TagPolicy:
205
+ """Updates an existing tag policy.
206
+
207
+ :param tag_key: str
208
+ :param tag_policy: :class:`TagPolicy`
209
+ :param update_mask: str
210
+ The field mask must be a single string, with multiple fields separated by commas (no spaces). The
211
+ field path is relative to the resource object, using a dot (`.`) to navigate sub-fields (e.g.,
212
+ `author.given_name`). Specification of elements in sequence or map fields is not allowed, as only
213
+ the entire collection field can be specified. Field names must exactly match the resource field
214
+ names.
215
+
216
+ A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
217
+ fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the API
218
+ changes in the future.
219
+
220
+ :returns: :class:`TagPolicy`
221
+ """
222
+ body = tag_policy.as_dict()
223
+ query = {}
224
+ if update_mask is not None:
225
+ query["update_mask"] = update_mask
226
+ headers = {
227
+ "Accept": "application/json",
228
+ "Content-Type": "application/json",
229
+ }
230
+
231
+ res = self._api.do("PATCH", f"/api/2.1/tag-policies/{tag_key}", query=query, body=body, headers=headers)
232
+ return TagPolicy.from_dict(res)
@@ -377,7 +377,10 @@ class DirectAccessVectorIndexSpec:
377
377
  @dataclass
378
378
  class EmbeddingSourceColumn:
379
379
  embedding_model_endpoint_name: Optional[str] = None
380
- """Name of the embedding model endpoint"""
380
+ """Name of the embedding model endpoint, used by default for both ingestion and querying."""
381
+
382
+ model_endpoint_name_for_query: Optional[str] = None
383
+ """Name of the embedding model endpoint which, if specified, is used for querying (not ingestion)."""
381
384
 
382
385
  name: Optional[str] = None
383
386
  """Name of the column"""
@@ -387,6 +390,8 @@ class EmbeddingSourceColumn:
387
390
  body = {}
388
391
  if self.embedding_model_endpoint_name is not None:
389
392
  body["embedding_model_endpoint_name"] = self.embedding_model_endpoint_name
393
+ if self.model_endpoint_name_for_query is not None:
394
+ body["model_endpoint_name_for_query"] = self.model_endpoint_name_for_query
390
395
  if self.name is not None:
391
396
  body["name"] = self.name
392
397
  return body
@@ -396,6 +401,8 @@ class EmbeddingSourceColumn:
396
401
  body = {}
397
402
  if self.embedding_model_endpoint_name is not None:
398
403
  body["embedding_model_endpoint_name"] = self.embedding_model_endpoint_name
404
+ if self.model_endpoint_name_for_query is not None:
405
+ body["model_endpoint_name_for_query"] = self.model_endpoint_name_for_query
399
406
  if self.name is not None:
400
407
  body["name"] = self.name
401
408
  return body
@@ -403,7 +410,11 @@ class EmbeddingSourceColumn:
403
410
  @classmethod
404
411
  def from_dict(cls, d: Dict[str, Any]) -> EmbeddingSourceColumn:
405
412
  """Deserializes the EmbeddingSourceColumn from a dictionary."""
406
- return cls(embedding_model_endpoint_name=d.get("embedding_model_endpoint_name", None), name=d.get("name", None))
413
+ return cls(
414
+ embedding_model_endpoint_name=d.get("embedding_model_endpoint_name", None),
415
+ model_endpoint_name_for_query=d.get("model_endpoint_name_for_query", None),
416
+ name=d.get("name", None),
417
+ )
407
418
 
408
419
 
409
420
  @dataclass
@@ -861,6 +872,60 @@ class QueryVectorIndexResponse:
861
872
  )
862
873
 
863
874
 
875
+ @dataclass
876
+ class RerankerConfig:
877
+ model: Optional[str] = None
878
+
879
+ parameters: Optional[RerankerConfigRerankerParameters] = None
880
+
881
+ def as_dict(self) -> dict:
882
+ """Serializes the RerankerConfig into a dictionary suitable for use as a JSON request body."""
883
+ body = {}
884
+ if self.model is not None:
885
+ body["model"] = self.model
886
+ if self.parameters:
887
+ body["parameters"] = self.parameters.as_dict()
888
+ return body
889
+
890
+ def as_shallow_dict(self) -> dict:
891
+ """Serializes the RerankerConfig into a shallow dictionary of its immediate attributes."""
892
+ body = {}
893
+ if self.model is not None:
894
+ body["model"] = self.model
895
+ if self.parameters:
896
+ body["parameters"] = self.parameters
897
+ return body
898
+
899
+ @classmethod
900
+ def from_dict(cls, d: Dict[str, Any]) -> RerankerConfig:
901
+ """Deserializes the RerankerConfig from a dictionary."""
902
+ return cls(model=d.get("model", None), parameters=_from_dict(d, "parameters", RerankerConfigRerankerParameters))
903
+
904
+
905
+ @dataclass
906
+ class RerankerConfigRerankerParameters:
907
+ columns_to_rerank: Optional[List[str]] = None
908
+
909
+ def as_dict(self) -> dict:
910
+ """Serializes the RerankerConfigRerankerParameters into a dictionary suitable for use as a JSON request body."""
911
+ body = {}
912
+ if self.columns_to_rerank:
913
+ body["columns_to_rerank"] = [v for v in self.columns_to_rerank]
914
+ return body
915
+
916
+ def as_shallow_dict(self) -> dict:
917
+ """Serializes the RerankerConfigRerankerParameters into a shallow dictionary of its immediate attributes."""
918
+ body = {}
919
+ if self.columns_to_rerank:
920
+ body["columns_to_rerank"] = self.columns_to_rerank
921
+ return body
922
+
923
+ @classmethod
924
+ def from_dict(cls, d: Dict[str, Any]) -> RerankerConfigRerankerParameters:
925
+ """Deserializes the RerankerConfigRerankerParameters from a dictionary."""
926
+ return cls(columns_to_rerank=d.get("columns_to_rerank", None))
927
+
928
+
864
929
  @dataclass
865
930
  class ResultData:
866
931
  """Data returned in the query result."""
@@ -1457,7 +1522,8 @@ class VectorSearchEndpointsAPI:
1457
1522
  :param endpoint_name: str
1458
1523
  Name of the vector search endpoint
1459
1524
  :param budget_policy_id: str
1460
- The budget policy id to be applied
1525
+ The budget policy id to be applied (hima-sheth) TODO: remove this once we've migrated to usage
1526
+ policies
1461
1527
 
1462
1528
  :returns: :class:`PatchEndpointBudgetPolicyResponse`
1463
1529
  """
@@ -1597,20 +1663,27 @@ class VectorSearchIndexesAPI:
1597
1663
 
1598
1664
  self._api.do("DELETE", f"/api/2.0/vector-search/indexes/{index_name}", headers=headers)
1599
1665
 
1600
- def get_index(self, index_name: str) -> VectorIndex:
1666
+ def get_index(self, index_name: str, *, ensure_reranker_compatible: Optional[bool] = None) -> VectorIndex:
1601
1667
  """Get an index.
1602
1668
 
1603
1669
  :param index_name: str
1604
1670
  Name of the index
1671
+ :param ensure_reranker_compatible: bool (optional)
1672
+ If true, the URL returned for the index is guaranteed to be compatible with the reranker. Currently
1673
+ this means we return the CP URL regardless of how the index is being accessed. If not set or set to
1674
+ false, the URL may still be compatible with the reranker depending on what URL we return.
1605
1675
 
1606
1676
  :returns: :class:`VectorIndex`
1607
1677
  """
1608
1678
 
1679
+ query = {}
1680
+ if ensure_reranker_compatible is not None:
1681
+ query["ensure_reranker_compatible"] = ensure_reranker_compatible
1609
1682
  headers = {
1610
1683
  "Accept": "application/json",
1611
1684
  }
1612
1685
 
1613
- res = self._api.do("GET", f"/api/2.0/vector-search/indexes/{index_name}", headers=headers)
1686
+ res = self._api.do("GET", f"/api/2.0/vector-search/indexes/{index_name}", query=query, headers=headers)
1614
1687
  return VectorIndex.from_dict(res)
1615
1688
 
1616
1689
  def list_indexes(self, endpoint_name: str, *, page_token: Optional[str] = None) -> Iterator[MiniVectorIndex]:
@@ -1653,6 +1726,7 @@ class VectorSearchIndexesAPI:
1653
1726
  query_text: Optional[str] = None,
1654
1727
  query_type: Optional[str] = None,
1655
1728
  query_vector: Optional[List[float]] = None,
1729
+ reranker: Optional[RerankerConfig] = None,
1656
1730
  score_threshold: Optional[float] = None,
1657
1731
  ) -> QueryVectorIndexResponse:
1658
1732
  """Query the specified vector index.
@@ -1680,6 +1754,7 @@ class VectorSearchIndexesAPI:
1680
1754
  :param query_vector: List[float] (optional)
1681
1755
  Query vector. Required for Direct Vector Access Index and Delta Sync Index using self-managed
1682
1756
  vectors.
1757
+ :param reranker: :class:`RerankerConfig` (optional)
1683
1758
  :param score_threshold: float (optional)
1684
1759
  Threshold for the approximate nearest neighbor search. Defaults to 0.0.
1685
1760
 
@@ -1700,6 +1775,8 @@ class VectorSearchIndexesAPI:
1700
1775
  body["query_type"] = query_type
1701
1776
  if query_vector is not None:
1702
1777
  body["query_vector"] = [v for v in query_vector]
1778
+ if reranker is not None:
1779
+ body["reranker"] = reranker.as_dict()
1703
1780
  if score_threshold is not None:
1704
1781
  body["score_threshold"] = score_threshold
1705
1782
  headers = {
databricks/sdk/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.63.0"
1
+ __version__ = "0.65.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: databricks-sdk
3
- Version: 0.63.0
3
+ Version: 0.65.0
4
4
  Summary: Databricks SDK for Python (Beta)
5
5
  Project-URL: Documentation, https://databricks-sdk-py.readthedocs.io
6
6
  Keywords: databricks,sdk
@@ -26,7 +26,7 @@ Requires-Dist: google-auth~=2.0
26
26
  Provides-Extra: dev
27
27
  Requires-Dist: pytest; extra == "dev"
28
28
  Requires-Dist: pytest-cov; extra == "dev"
29
- Requires-Dist: pytest-xdist; extra == "dev"
29
+ Requires-Dist: pytest-xdist<4.0,>=3.6.1; extra == "dev"
30
30
  Requires-Dist: pytest-mock; extra == "dev"
31
31
  Requires-Dist: black; extra == "dev"
32
32
  Requires-Dist: pycodestyle; extra == "dev"