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

Files changed (30) hide show
  1. databricks/sdk/__init__.py +25 -4
  2. databricks/sdk/service/aibuilder.py +0 -36
  3. databricks/sdk/service/apps.py +1 -3
  4. databricks/sdk/service/billing.py +53 -23
  5. databricks/sdk/service/catalog.py +1692 -150
  6. databricks/sdk/service/cleanrooms.py +3 -22
  7. databricks/sdk/service/compute.py +245 -322
  8. databricks/sdk/service/dashboards.py +129 -162
  9. databricks/sdk/service/database.py +612 -97
  10. databricks/sdk/service/iam.py +3 -3
  11. databricks/sdk/service/jobs.py +6 -129
  12. databricks/sdk/service/marketplace.py +3 -2
  13. databricks/sdk/service/ml.py +713 -262
  14. databricks/sdk/service/oauth2.py +0 -1
  15. databricks/sdk/service/pipelines.py +12 -29
  16. databricks/sdk/service/provisioning.py +7 -125
  17. databricks/sdk/service/qualitymonitorv2.py +0 -18
  18. databricks/sdk/service/serving.py +39 -13
  19. databricks/sdk/service/settings.py +11 -128
  20. databricks/sdk/service/sharing.py +3 -9
  21. databricks/sdk/service/sql.py +94 -74
  22. databricks/sdk/service/vectorsearch.py +0 -19
  23. databricks/sdk/service/workspace.py +2 -6
  24. databricks/sdk/version.py +1 -1
  25. {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.58.0.dist-info}/METADATA +1 -1
  26. {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.58.0.dist-info}/RECORD +30 -30
  27. {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.58.0.dist-info}/WHEEL +0 -0
  28. {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.58.0.dist-info}/licenses/LICENSE +0 -0
  29. {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.58.0.dist-info}/licenses/NOTICE +0 -0
  30. {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.58.0.dist-info}/top_level.txt +0 -0
@@ -253,42 +253,6 @@ class DashboardView(Enum):
253
253
  DASHBOARD_VIEW_BASIC = "DASHBOARD_VIEW_BASIC"
254
254
 
255
255
 
256
- @dataclass
257
- class DeleteScheduleResponse:
258
- def as_dict(self) -> dict:
259
- """Serializes the DeleteScheduleResponse into a dictionary suitable for use as a JSON request body."""
260
- body = {}
261
- return body
262
-
263
- def as_shallow_dict(self) -> dict:
264
- """Serializes the DeleteScheduleResponse into a shallow dictionary of its immediate attributes."""
265
- body = {}
266
- return body
267
-
268
- @classmethod
269
- def from_dict(cls, d: Dict[str, Any]) -> DeleteScheduleResponse:
270
- """Deserializes the DeleteScheduleResponse from a dictionary."""
271
- return cls()
272
-
273
-
274
- @dataclass
275
- class DeleteSubscriptionResponse:
276
- def as_dict(self) -> dict:
277
- """Serializes the DeleteSubscriptionResponse into a dictionary suitable for use as a JSON request body."""
278
- body = {}
279
- return body
280
-
281
- def as_shallow_dict(self) -> dict:
282
- """Serializes the DeleteSubscriptionResponse into a shallow dictionary of its immediate attributes."""
283
- body = {}
284
- return body
285
-
286
- @classmethod
287
- def from_dict(cls, d: Dict[str, Any]) -> DeleteSubscriptionResponse:
288
- """Deserializes the DeleteSubscriptionResponse from a dictionary."""
289
- return cls()
290
-
291
-
292
256
  @dataclass
293
257
  class GenieAttachment:
294
258
  """Genie AI Response"""
@@ -409,6 +373,46 @@ class GenieConversation:
409
373
  )
410
374
 
411
375
 
376
+ @dataclass
377
+ class GenieConversationSummary:
378
+ conversation_id: str
379
+
380
+ title: str
381
+
382
+ created_timestamp: int
383
+
384
+ def as_dict(self) -> dict:
385
+ """Serializes the GenieConversationSummary into a dictionary suitable for use as a JSON request body."""
386
+ body = {}
387
+ if self.conversation_id is not None:
388
+ body["conversation_id"] = self.conversation_id
389
+ if self.created_timestamp is not None:
390
+ body["created_timestamp"] = self.created_timestamp
391
+ if self.title is not None:
392
+ body["title"] = self.title
393
+ return body
394
+
395
+ def as_shallow_dict(self) -> dict:
396
+ """Serializes the GenieConversationSummary into a shallow dictionary of its immediate attributes."""
397
+ body = {}
398
+ if self.conversation_id is not None:
399
+ body["conversation_id"] = self.conversation_id
400
+ if self.created_timestamp is not None:
401
+ body["created_timestamp"] = self.created_timestamp
402
+ if self.title is not None:
403
+ body["title"] = self.title
404
+ return body
405
+
406
+ @classmethod
407
+ def from_dict(cls, d: Dict[str, Any]) -> GenieConversationSummary:
408
+ """Deserializes the GenieConversationSummary from a dictionary."""
409
+ return cls(
410
+ conversation_id=d.get("conversation_id", None),
411
+ created_timestamp=d.get("created_timestamp", None),
412
+ title=d.get("title", None),
413
+ )
414
+
415
+
412
416
  @dataclass
413
417
  class GenieCreateConversationMessageRequest:
414
418
  content: str
@@ -453,80 +457,64 @@ class GenieCreateConversationMessageRequest:
453
457
 
454
458
 
455
459
  @dataclass
456
- class GenieGenerateDownloadFullQueryResultResponse:
457
- download_id: Optional[str] = None
458
- """Download ID. Use this ID to track the download request in subsequent polling calls"""
459
-
460
- def as_dict(self) -> dict:
461
- """Serializes the GenieGenerateDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body."""
462
- body = {}
463
- if self.download_id is not None:
464
- body["download_id"] = self.download_id
465
- return body
466
-
467
- def as_shallow_dict(self) -> dict:
468
- """Serializes the GenieGenerateDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes."""
469
- body = {}
470
- if self.download_id is not None:
471
- body["download_id"] = self.download_id
472
- return body
473
-
474
- @classmethod
475
- def from_dict(cls, d: Dict[str, Any]) -> GenieGenerateDownloadFullQueryResultResponse:
476
- """Deserializes the GenieGenerateDownloadFullQueryResultResponse from a dictionary."""
477
- return cls(download_id=d.get("download_id", None))
478
-
479
-
480
- @dataclass
481
- class GenieGetDownloadFullQueryResultResponse:
460
+ class GenieGetMessageQueryResultResponse:
482
461
  statement_response: Optional[sql.StatementResponse] = None
483
462
  """SQL Statement Execution response. See [Get status, manifest, and result first
484
463
  chunk](:method:statementexecution/getstatement) for more details."""
485
464
 
486
465
  def as_dict(self) -> dict:
487
- """Serializes the GenieGetDownloadFullQueryResultResponse into a dictionary suitable for use as a JSON request body."""
466
+ """Serializes the GenieGetMessageQueryResultResponse into a dictionary suitable for use as a JSON request body."""
488
467
  body = {}
489
468
  if self.statement_response:
490
469
  body["statement_response"] = self.statement_response.as_dict()
491
470
  return body
492
471
 
493
472
  def as_shallow_dict(self) -> dict:
494
- """Serializes the GenieGetDownloadFullQueryResultResponse into a shallow dictionary of its immediate attributes."""
473
+ """Serializes the GenieGetMessageQueryResultResponse into a shallow dictionary of its immediate attributes."""
495
474
  body = {}
496
475
  if self.statement_response:
497
476
  body["statement_response"] = self.statement_response
498
477
  return body
499
478
 
500
479
  @classmethod
501
- def from_dict(cls, d: Dict[str, Any]) -> GenieGetDownloadFullQueryResultResponse:
502
- """Deserializes the GenieGetDownloadFullQueryResultResponse from a dictionary."""
480
+ def from_dict(cls, d: Dict[str, Any]) -> GenieGetMessageQueryResultResponse:
481
+ """Deserializes the GenieGetMessageQueryResultResponse from a dictionary."""
503
482
  return cls(statement_response=_from_dict(d, "statement_response", sql.StatementResponse))
504
483
 
505
484
 
506
485
  @dataclass
507
- class GenieGetMessageQueryResultResponse:
508
- statement_response: Optional[sql.StatementResponse] = None
509
- """SQL Statement Execution response. See [Get status, manifest, and result first
510
- chunk](:method:statementexecution/getstatement) for more details."""
486
+ class GenieListConversationsResponse:
487
+ conversations: Optional[List[GenieConversationSummary]] = None
488
+ """List of conversations in the Genie space"""
489
+
490
+ next_page_token: Optional[str] = None
491
+ """Token to get the next page of results"""
511
492
 
512
493
  def as_dict(self) -> dict:
513
- """Serializes the GenieGetMessageQueryResultResponse into a dictionary suitable for use as a JSON request body."""
494
+ """Serializes the GenieListConversationsResponse into a dictionary suitable for use as a JSON request body."""
514
495
  body = {}
515
- if self.statement_response:
516
- body["statement_response"] = self.statement_response.as_dict()
496
+ if self.conversations:
497
+ body["conversations"] = [v.as_dict() for v in self.conversations]
498
+ if self.next_page_token is not None:
499
+ body["next_page_token"] = self.next_page_token
517
500
  return body
518
501
 
519
502
  def as_shallow_dict(self) -> dict:
520
- """Serializes the GenieGetMessageQueryResultResponse into a shallow dictionary of its immediate attributes."""
503
+ """Serializes the GenieListConversationsResponse into a shallow dictionary of its immediate attributes."""
521
504
  body = {}
522
- if self.statement_response:
523
- body["statement_response"] = self.statement_response
505
+ if self.conversations:
506
+ body["conversations"] = self.conversations
507
+ if self.next_page_token is not None:
508
+ body["next_page_token"] = self.next_page_token
524
509
  return body
525
510
 
526
511
  @classmethod
527
- def from_dict(cls, d: Dict[str, Any]) -> GenieGetMessageQueryResultResponse:
528
- """Deserializes the GenieGetMessageQueryResultResponse from a dictionary."""
529
- return cls(statement_response=_from_dict(d, "statement_response", sql.StatementResponse))
512
+ def from_dict(cls, d: Dict[str, Any]) -> GenieListConversationsResponse:
513
+ """Deserializes the GenieListConversationsResponse from a dictionary."""
514
+ return cls(
515
+ conversations=_repeated_dict(d, "conversations", GenieConversationSummary),
516
+ next_page_token=d.get("next_page_token", None),
517
+ )
530
518
 
531
519
 
532
520
  @dataclass
@@ -595,20 +583,6 @@ class GenieMessage:
595
583
  `query_result_metadata` in `GenieQueryAttachment` instead."""
596
584
 
597
585
  status: Optional[MessageStatus] = None
598
- """MessageStatus. The possible values are: * `FETCHING_METADATA`: Fetching metadata from the data
599
- sources. * `FILTERING_CONTEXT`: Running smart context step to determine relevant context. *
600
- `ASKING_AI`: Waiting for the LLM to respond to the user's question. * `PENDING_WAREHOUSE`:
601
- Waiting for warehouse before the SQL query can start executing. * `EXECUTING_QUERY`: Executing a
602
- generated SQL query. Get the SQL query result by calling
603
- [getMessageAttachmentQueryResult](:method:genie/getMessageAttachmentQueryResult) API. *
604
- `FAILED`: The response generation or query execution failed. See `error` field. * `COMPLETED`:
605
- Message processing is completed. Results are in the `attachments` field. Get the SQL query
606
- result by calling
607
- [getMessageAttachmentQueryResult](:method:genie/getMessageAttachmentQueryResult) API. *
608
- `SUBMITTED`: Message has been submitted. * `QUERY_RESULT_EXPIRED`: SQL result is not available
609
- anymore. The user needs to rerun the query. Rerun the SQL query result by calling
610
- [executeMessageAttachmentQuery](:method:genie/executeMessageAttachmentQuery) API. * `CANCELLED`:
611
- Message has been cancelled."""
612
586
 
613
587
  user_id: Optional[int] = None
614
588
  """ID of the user who created the message"""
@@ -1801,6 +1775,23 @@ class GenieAPI:
1801
1775
  timeout=timeout
1802
1776
  )
1803
1777
 
1778
+ def delete_conversation(self, space_id: str, conversation_id: str):
1779
+ """Delete a conversation.
1780
+
1781
+ :param space_id: str
1782
+ The ID associated with the Genie space where the conversation is located.
1783
+ :param conversation_id: str
1784
+ The ID of the conversation to delete.
1785
+
1786
+
1787
+ """
1788
+
1789
+ headers = {
1790
+ "Accept": "application/json",
1791
+ }
1792
+
1793
+ self._api.do("DELETE", f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}", headers=headers)
1794
+
1804
1795
  def execute_message_attachment_query(
1805
1796
  self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
1806
1797
  ) -> GenieGetMessageQueryResultResponse:
@@ -1856,75 +1847,6 @@ class GenieAPI:
1856
1847
  )
1857
1848
  return GenieGetMessageQueryResultResponse.from_dict(res)
1858
1849
 
1859
- def generate_download_full_query_result(
1860
- self, space_id: str, conversation_id: str, message_id: str, attachment_id: str
1861
- ) -> GenieGenerateDownloadFullQueryResultResponse:
1862
- """Initiates a new SQL execution and returns a `download_id` that you can use to track the progress of
1863
- the download. The query result is stored in an external link and can be retrieved using the [Get
1864
- Download Full Query Result](:method:genie/getdownloadfullqueryresult) API. Warning: Databricks
1865
- strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.
1866
- See [Execute Statement](:method:statementexecution/executestatement) for more details.
1867
-
1868
- :param space_id: str
1869
- Genie space ID
1870
- :param conversation_id: str
1871
- Conversation ID
1872
- :param message_id: str
1873
- Message ID
1874
- :param attachment_id: str
1875
- Attachment ID
1876
-
1877
- :returns: :class:`GenieGenerateDownloadFullQueryResultResponse`
1878
- """
1879
-
1880
- headers = {
1881
- "Accept": "application/json",
1882
- }
1883
-
1884
- res = self._api.do(
1885
- "POST",
1886
- f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/downloads",
1887
- headers=headers,
1888
- )
1889
- return GenieGenerateDownloadFullQueryResultResponse.from_dict(res)
1890
-
1891
- def get_download_full_query_result(
1892
- self, space_id: str, conversation_id: str, message_id: str, attachment_id: str, download_id: str
1893
- ) -> GenieGetDownloadFullQueryResultResponse:
1894
- """After [Generating a Full Query Result Download](:method:genie/getdownloadfullqueryresult) and
1895
- successfully receiving a `download_id`, use this API to poll the download progress. When the download
1896
- is complete, the API returns one or more external links to the query result files. Warning: Databricks
1897
- strongly recommends that you protect the URLs that are returned by the `EXTERNAL_LINKS` disposition.
1898
- You must not set an Authorization header in download requests. When using the `EXTERNAL_LINKS`
1899
- disposition, Databricks returns presigned URLs that grant temporary access to data. See [Execute
1900
- Statement](:method:statementexecution/executestatement) for more details.
1901
-
1902
- :param space_id: str
1903
- Genie space ID
1904
- :param conversation_id: str
1905
- Conversation ID
1906
- :param message_id: str
1907
- Message ID
1908
- :param attachment_id: str
1909
- Attachment ID
1910
- :param download_id: str
1911
- Download ID. This ID is provided by the [Generate Download
1912
- endpoint](:method:genie/generateDownloadFullQueryResult)
1913
-
1914
- :returns: :class:`GenieGetDownloadFullQueryResultResponse`
1915
- """
1916
-
1917
- headers = {
1918
- "Accept": "application/json",
1919
- }
1920
-
1921
- res = self._api.do(
1922
- "GET",
1923
- f"/api/2.0/genie/spaces/{space_id}/conversations/{conversation_id}/messages/{message_id}/attachments/{attachment_id}/downloads/{download_id}",
1924
- headers=headers,
1925
- )
1926
- return GenieGetDownloadFullQueryResultResponse.from_dict(res)
1927
-
1928
1850
  def get_message(self, space_id: str, conversation_id: str, message_id: str) -> GenieMessage:
1929
1851
  """Get message from conversation.
1930
1852
 
@@ -2050,6 +1972,33 @@ class GenieAPI:
2050
1972
  res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}", headers=headers)
2051
1973
  return GenieSpace.from_dict(res)
2052
1974
 
1975
+ def list_conversations(
1976
+ self, space_id: str, *, page_size: Optional[int] = None, page_token: Optional[str] = None
1977
+ ) -> GenieListConversationsResponse:
1978
+ """Get a list of conversations in a Genie Space.
1979
+
1980
+ :param space_id: str
1981
+ The ID of the Genie space to retrieve conversations from.
1982
+ :param page_size: int (optional)
1983
+ Maximum number of conversations to return per page
1984
+ :param page_token: str (optional)
1985
+ Token to get the next page of results
1986
+
1987
+ :returns: :class:`GenieListConversationsResponse`
1988
+ """
1989
+
1990
+ query = {}
1991
+ if page_size is not None:
1992
+ query["page_size"] = page_size
1993
+ if page_token is not None:
1994
+ query["page_token"] = page_token
1995
+ headers = {
1996
+ "Accept": "application/json",
1997
+ }
1998
+
1999
+ res = self._api.do("GET", f"/api/2.0/genie/spaces/{space_id}/conversations", query=query, headers=headers)
2000
+ return GenieListConversationsResponse.from_dict(res)
2001
+
2053
2002
  def list_spaces(
2054
2003
  self, *, page_size: Optional[int] = None, page_token: Optional[str] = None
2055
2004
  ) -> GenieListSpacesResponse:
@@ -2109,6 +2058,21 @@ class GenieAPI:
2109
2058
  def start_conversation_and_wait(self, space_id: str, content: str, timeout=timedelta(minutes=20)) -> GenieMessage:
2110
2059
  return self.start_conversation(content=content, space_id=space_id).result(timeout=timeout)
2111
2060
 
2061
+ def trash_space(self, space_id: str):
2062
+ """Move a Genie Space to the trash.
2063
+
2064
+ :param space_id: str
2065
+ The ID associated with the Genie space to be sent to the trash.
2066
+
2067
+
2068
+ """
2069
+
2070
+ headers = {
2071
+ "Accept": "application/json",
2072
+ }
2073
+
2074
+ self._api.do("DELETE", f"/api/2.0/genie/spaces/{space_id}", headers=headers)
2075
+
2112
2076
 
2113
2077
  class LakeviewAPI:
2114
2078
  """These APIs provide specific management operations for Lakeview dashboards. Generic resource management can
@@ -2139,6 +2103,7 @@ class LakeviewAPI:
2139
2103
  :param dashboard_id: str
2140
2104
  UUID identifying the dashboard to which the schedule belongs.
2141
2105
  :param schedule: :class:`Schedule`
2106
+ The schedule to create. A dashboard is limited to 10 schedules.
2142
2107
 
2143
2108
  :returns: :class:`Schedule`
2144
2109
  """
@@ -2159,6 +2124,7 @@ class LakeviewAPI:
2159
2124
  :param schedule_id: str
2160
2125
  UUID identifying the schedule to which the subscription belongs.
2161
2126
  :param subscription: :class:`Subscription`
2127
+ The subscription to create. A schedule is limited to 100 subscriptions.
2162
2128
 
2163
2129
  :returns: :class:`Subscription`
2164
2130
  """
@@ -2558,6 +2524,7 @@ class LakeviewAPI:
2558
2524
  :param schedule_id: str
2559
2525
  UUID identifying the schedule.
2560
2526
  :param schedule: :class:`Schedule`
2527
+ The schedule to update.
2561
2528
 
2562
2529
  :returns: :class:`Schedule`
2563
2530
  """