databricks-sdk 0.38.0__py3-none-any.whl → 0.40.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.
- databricks/sdk/__init__.py +36 -1
- databricks/sdk/mixins/open_ai_client.py +2 -2
- databricks/sdk/service/apps.py +175 -0
- databricks/sdk/service/billing.py +247 -0
- databricks/sdk/service/catalog.py +1795 -62
- databricks/sdk/service/cleanrooms.py +1281 -0
- databricks/sdk/service/compute.py +1843 -67
- databricks/sdk/service/dashboards.py +342 -3
- databricks/sdk/service/files.py +162 -2
- databricks/sdk/service/iam.py +351 -0
- databricks/sdk/service/jobs.py +1355 -24
- databricks/sdk/service/marketplace.py +688 -0
- databricks/sdk/service/ml.py +1038 -2
- databricks/sdk/service/oauth2.py +636 -0
- databricks/sdk/service/pipelines.py +524 -4
- databricks/sdk/service/provisioning.py +387 -0
- databricks/sdk/service/serving.py +615 -0
- databricks/sdk/service/settings.py +1186 -1
- databricks/sdk/service/sharing.py +326 -2
- databricks/sdk/service/sql.py +1186 -2
- databricks/sdk/service/vectorsearch.py +290 -0
- databricks/sdk/service/workspace.py +451 -0
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.38.0.dist-info → databricks_sdk-0.40.0.dist-info}/METADATA +26 -26
- {databricks_sdk-0.38.0.dist-info → databricks_sdk-0.40.0.dist-info}/RECORD +29 -28
- {databricks_sdk-0.38.0.dist-info → databricks_sdk-0.40.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.38.0.dist-info → databricks_sdk-0.40.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.38.0.dist-info → databricks_sdk-0.40.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.38.0.dist-info → databricks_sdk-0.40.0.dist-info}/top_level.txt +0 -0
|
@@ -42,6 +42,14 @@ class CronSchedule:
|
|
|
42
42
|
if self.timezone_id is not None: body['timezone_id'] = self.timezone_id
|
|
43
43
|
return body
|
|
44
44
|
|
|
45
|
+
def as_shallow_dict(self) -> dict:
|
|
46
|
+
"""Serializes the CronSchedule into a shallow dictionary of its immediate attributes."""
|
|
47
|
+
body = {}
|
|
48
|
+
if self.quartz_cron_expression is not None:
|
|
49
|
+
body['quartz_cron_expression'] = self.quartz_cron_expression
|
|
50
|
+
if self.timezone_id is not None: body['timezone_id'] = self.timezone_id
|
|
51
|
+
return body
|
|
52
|
+
|
|
45
53
|
@classmethod
|
|
46
54
|
def from_dict(cls, d: Dict[str, any]) -> CronSchedule:
|
|
47
55
|
"""Deserializes the CronSchedule from a dictionary."""
|
|
@@ -105,6 +113,21 @@ class Dashboard:
|
|
|
105
113
|
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
106
114
|
return body
|
|
107
115
|
|
|
116
|
+
def as_shallow_dict(self) -> dict:
|
|
117
|
+
"""Serializes the Dashboard into a shallow dictionary of its immediate attributes."""
|
|
118
|
+
body = {}
|
|
119
|
+
if self.create_time is not None: body['create_time'] = self.create_time
|
|
120
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
121
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
122
|
+
if self.etag is not None: body['etag'] = self.etag
|
|
123
|
+
if self.lifecycle_state is not None: body['lifecycle_state'] = self.lifecycle_state
|
|
124
|
+
if self.parent_path is not None: body['parent_path'] = self.parent_path
|
|
125
|
+
if self.path is not None: body['path'] = self.path
|
|
126
|
+
if self.serialized_dashboard is not None: body['serialized_dashboard'] = self.serialized_dashboard
|
|
127
|
+
if self.update_time is not None: body['update_time'] = self.update_time
|
|
128
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
129
|
+
return body
|
|
130
|
+
|
|
108
131
|
@classmethod
|
|
109
132
|
def from_dict(cls, d: Dict[str, any]) -> Dashboard:
|
|
110
133
|
"""Deserializes the Dashboard from a dictionary."""
|
|
@@ -125,6 +148,27 @@ class DashboardView(Enum):
|
|
|
125
148
|
DASHBOARD_VIEW_BASIC = 'DASHBOARD_VIEW_BASIC'
|
|
126
149
|
|
|
127
150
|
|
|
151
|
+
class DataType(Enum):
|
|
152
|
+
|
|
153
|
+
DATA_TYPE_ARRAY = 'DATA_TYPE_ARRAY'
|
|
154
|
+
DATA_TYPE_BIG_INT = 'DATA_TYPE_BIG_INT'
|
|
155
|
+
DATA_TYPE_BINARY = 'DATA_TYPE_BINARY'
|
|
156
|
+
DATA_TYPE_BOOLEAN = 'DATA_TYPE_BOOLEAN'
|
|
157
|
+
DATA_TYPE_DATE = 'DATA_TYPE_DATE'
|
|
158
|
+
DATA_TYPE_DECIMAL = 'DATA_TYPE_DECIMAL'
|
|
159
|
+
DATA_TYPE_DOUBLE = 'DATA_TYPE_DOUBLE'
|
|
160
|
+
DATA_TYPE_FLOAT = 'DATA_TYPE_FLOAT'
|
|
161
|
+
DATA_TYPE_INT = 'DATA_TYPE_INT'
|
|
162
|
+
DATA_TYPE_INTERVAL = 'DATA_TYPE_INTERVAL'
|
|
163
|
+
DATA_TYPE_MAP = 'DATA_TYPE_MAP'
|
|
164
|
+
DATA_TYPE_SMALL_INT = 'DATA_TYPE_SMALL_INT'
|
|
165
|
+
DATA_TYPE_STRING = 'DATA_TYPE_STRING'
|
|
166
|
+
DATA_TYPE_STRUCT = 'DATA_TYPE_STRUCT'
|
|
167
|
+
DATA_TYPE_TIMESTAMP = 'DATA_TYPE_TIMESTAMP'
|
|
168
|
+
DATA_TYPE_TINY_INT = 'DATA_TYPE_TINY_INT'
|
|
169
|
+
DATA_TYPE_VOID = 'DATA_TYPE_VOID'
|
|
170
|
+
|
|
171
|
+
|
|
128
172
|
@dataclass
|
|
129
173
|
class DeleteScheduleResponse:
|
|
130
174
|
|
|
@@ -133,6 +177,11 @@ class DeleteScheduleResponse:
|
|
|
133
177
|
body = {}
|
|
134
178
|
return body
|
|
135
179
|
|
|
180
|
+
def as_shallow_dict(self) -> dict:
|
|
181
|
+
"""Serializes the DeleteScheduleResponse into a shallow dictionary of its immediate attributes."""
|
|
182
|
+
body = {}
|
|
183
|
+
return body
|
|
184
|
+
|
|
136
185
|
@classmethod
|
|
137
186
|
def from_dict(cls, d: Dict[str, any]) -> DeleteScheduleResponse:
|
|
138
187
|
"""Deserializes the DeleteScheduleResponse from a dictionary."""
|
|
@@ -147,6 +196,11 @@ class DeleteSubscriptionResponse:
|
|
|
147
196
|
body = {}
|
|
148
197
|
return body
|
|
149
198
|
|
|
199
|
+
def as_shallow_dict(self) -> dict:
|
|
200
|
+
"""Serializes the DeleteSubscriptionResponse into a shallow dictionary of its immediate attributes."""
|
|
201
|
+
body = {}
|
|
202
|
+
return body
|
|
203
|
+
|
|
150
204
|
@classmethod
|
|
151
205
|
def from_dict(cls, d: Dict[str, any]) -> DeleteSubscriptionResponse:
|
|
152
206
|
"""Deserializes the DeleteSubscriptionResponse from a dictionary."""
|
|
@@ -168,6 +222,13 @@ class GenieAttachment:
|
|
|
168
222
|
if self.text: body['text'] = self.text.as_dict()
|
|
169
223
|
return body
|
|
170
224
|
|
|
225
|
+
def as_shallow_dict(self) -> dict:
|
|
226
|
+
"""Serializes the GenieAttachment into a shallow dictionary of its immediate attributes."""
|
|
227
|
+
body = {}
|
|
228
|
+
if self.query: body['query'] = self.query
|
|
229
|
+
if self.text: body['text'] = self.text
|
|
230
|
+
return body
|
|
231
|
+
|
|
171
232
|
@classmethod
|
|
172
233
|
def from_dict(cls, d: Dict[str, any]) -> GenieAttachment:
|
|
173
234
|
"""Deserializes the GenieAttachment from a dictionary."""
|
|
@@ -206,6 +267,18 @@ class GenieConversation:
|
|
|
206
267
|
if self.user_id is not None: body['user_id'] = self.user_id
|
|
207
268
|
return body
|
|
208
269
|
|
|
270
|
+
def as_shallow_dict(self) -> dict:
|
|
271
|
+
"""Serializes the GenieConversation into a shallow dictionary of its immediate attributes."""
|
|
272
|
+
body = {}
|
|
273
|
+
if self.created_timestamp is not None: body['created_timestamp'] = self.created_timestamp
|
|
274
|
+
if self.id is not None: body['id'] = self.id
|
|
275
|
+
if self.last_updated_timestamp is not None:
|
|
276
|
+
body['last_updated_timestamp'] = self.last_updated_timestamp
|
|
277
|
+
if self.space_id is not None: body['space_id'] = self.space_id
|
|
278
|
+
if self.title is not None: body['title'] = self.title
|
|
279
|
+
if self.user_id is not None: body['user_id'] = self.user_id
|
|
280
|
+
return body
|
|
281
|
+
|
|
209
282
|
@classmethod
|
|
210
283
|
def from_dict(cls, d: Dict[str, any]) -> GenieConversation:
|
|
211
284
|
"""Deserializes the GenieConversation from a dictionary."""
|
|
@@ -236,6 +309,14 @@ class GenieCreateConversationMessageRequest:
|
|
|
236
309
|
if self.space_id is not None: body['space_id'] = self.space_id
|
|
237
310
|
return body
|
|
238
311
|
|
|
312
|
+
def as_shallow_dict(self) -> dict:
|
|
313
|
+
"""Serializes the GenieCreateConversationMessageRequest into a shallow dictionary of its immediate attributes."""
|
|
314
|
+
body = {}
|
|
315
|
+
if self.content is not None: body['content'] = self.content
|
|
316
|
+
if self.conversation_id is not None: body['conversation_id'] = self.conversation_id
|
|
317
|
+
if self.space_id is not None: body['space_id'] = self.space_id
|
|
318
|
+
return body
|
|
319
|
+
|
|
239
320
|
@classmethod
|
|
240
321
|
def from_dict(cls, d: Dict[str, any]) -> GenieCreateConversationMessageRequest:
|
|
241
322
|
"""Deserializes the GenieCreateConversationMessageRequest from a dictionary."""
|
|
@@ -256,6 +337,12 @@ class GenieGetMessageQueryResultResponse:
|
|
|
256
337
|
if self.statement_response: body['statement_response'] = self.statement_response.as_dict()
|
|
257
338
|
return body
|
|
258
339
|
|
|
340
|
+
def as_shallow_dict(self) -> dict:
|
|
341
|
+
"""Serializes the GenieGetMessageQueryResultResponse into a shallow dictionary of its immediate attributes."""
|
|
342
|
+
body = {}
|
|
343
|
+
if self.statement_response: body['statement_response'] = self.statement_response
|
|
344
|
+
return body
|
|
345
|
+
|
|
259
346
|
@classmethod
|
|
260
347
|
def from_dict(cls, d: Dict[str, any]) -> GenieGetMessageQueryResultResponse:
|
|
261
348
|
"""Deserializes the GenieGetMessageQueryResultResponse from a dictionary."""
|
|
@@ -325,6 +412,23 @@ class GenieMessage:
|
|
|
325
412
|
if self.user_id is not None: body['user_id'] = self.user_id
|
|
326
413
|
return body
|
|
327
414
|
|
|
415
|
+
def as_shallow_dict(self) -> dict:
|
|
416
|
+
"""Serializes the GenieMessage into a shallow dictionary of its immediate attributes."""
|
|
417
|
+
body = {}
|
|
418
|
+
if self.attachments: body['attachments'] = self.attachments
|
|
419
|
+
if self.content is not None: body['content'] = self.content
|
|
420
|
+
if self.conversation_id is not None: body['conversation_id'] = self.conversation_id
|
|
421
|
+
if self.created_timestamp is not None: body['created_timestamp'] = self.created_timestamp
|
|
422
|
+
if self.error: body['error'] = self.error
|
|
423
|
+
if self.id is not None: body['id'] = self.id
|
|
424
|
+
if self.last_updated_timestamp is not None:
|
|
425
|
+
body['last_updated_timestamp'] = self.last_updated_timestamp
|
|
426
|
+
if self.query_result: body['query_result'] = self.query_result
|
|
427
|
+
if self.space_id is not None: body['space_id'] = self.space_id
|
|
428
|
+
if self.status is not None: body['status'] = self.status
|
|
429
|
+
if self.user_id is not None: body['user_id'] = self.user_id
|
|
430
|
+
return body
|
|
431
|
+
|
|
328
432
|
@classmethod
|
|
329
433
|
def from_dict(cls, d: Dict[str, any]) -> GenieMessage:
|
|
330
434
|
"""Deserializes the GenieMessage from a dictionary."""
|
|
@@ -356,6 +460,13 @@ class GenieStartConversationMessageRequest:
|
|
|
356
460
|
if self.space_id is not None: body['space_id'] = self.space_id
|
|
357
461
|
return body
|
|
358
462
|
|
|
463
|
+
def as_shallow_dict(self) -> dict:
|
|
464
|
+
"""Serializes the GenieStartConversationMessageRequest into a shallow dictionary of its immediate attributes."""
|
|
465
|
+
body = {}
|
|
466
|
+
if self.content is not None: body['content'] = self.content
|
|
467
|
+
if self.space_id is not None: body['space_id'] = self.space_id
|
|
468
|
+
return body
|
|
469
|
+
|
|
359
470
|
@classmethod
|
|
360
471
|
def from_dict(cls, d: Dict[str, any]) -> GenieStartConversationMessageRequest:
|
|
361
472
|
"""Deserializes the GenieStartConversationMessageRequest from a dictionary."""
|
|
@@ -383,6 +494,15 @@ class GenieStartConversationResponse:
|
|
|
383
494
|
if self.message_id is not None: body['message_id'] = self.message_id
|
|
384
495
|
return body
|
|
385
496
|
|
|
497
|
+
def as_shallow_dict(self) -> dict:
|
|
498
|
+
"""Serializes the GenieStartConversationResponse into a shallow dictionary of its immediate attributes."""
|
|
499
|
+
body = {}
|
|
500
|
+
if self.conversation: body['conversation'] = self.conversation
|
|
501
|
+
if self.conversation_id is not None: body['conversation_id'] = self.conversation_id
|
|
502
|
+
if self.message: body['message'] = self.message
|
|
503
|
+
if self.message_id is not None: body['message_id'] = self.message_id
|
|
504
|
+
return body
|
|
505
|
+
|
|
386
506
|
@classmethod
|
|
387
507
|
def from_dict(cls, d: Dict[str, any]) -> GenieStartConversationResponse:
|
|
388
508
|
"""Deserializes the GenieStartConversationResponse from a dictionary."""
|
|
@@ -413,6 +533,13 @@ class ListDashboardsResponse:
|
|
|
413
533
|
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
414
534
|
return body
|
|
415
535
|
|
|
536
|
+
def as_shallow_dict(self) -> dict:
|
|
537
|
+
"""Serializes the ListDashboardsResponse into a shallow dictionary of its immediate attributes."""
|
|
538
|
+
body = {}
|
|
539
|
+
if self.dashboards: body['dashboards'] = self.dashboards
|
|
540
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
541
|
+
return body
|
|
542
|
+
|
|
416
543
|
@classmethod
|
|
417
544
|
def from_dict(cls, d: Dict[str, any]) -> ListDashboardsResponse:
|
|
418
545
|
"""Deserializes the ListDashboardsResponse from a dictionary."""
|
|
@@ -435,6 +562,13 @@ class ListSchedulesResponse:
|
|
|
435
562
|
if self.schedules: body['schedules'] = [v.as_dict() for v in self.schedules]
|
|
436
563
|
return body
|
|
437
564
|
|
|
565
|
+
def as_shallow_dict(self) -> dict:
|
|
566
|
+
"""Serializes the ListSchedulesResponse into a shallow dictionary of its immediate attributes."""
|
|
567
|
+
body = {}
|
|
568
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
569
|
+
if self.schedules: body['schedules'] = self.schedules
|
|
570
|
+
return body
|
|
571
|
+
|
|
438
572
|
@classmethod
|
|
439
573
|
def from_dict(cls, d: Dict[str, any]) -> ListSchedulesResponse:
|
|
440
574
|
"""Deserializes the ListSchedulesResponse from a dictionary."""
|
|
@@ -457,6 +591,13 @@ class ListSubscriptionsResponse:
|
|
|
457
591
|
if self.subscriptions: body['subscriptions'] = [v.as_dict() for v in self.subscriptions]
|
|
458
592
|
return body
|
|
459
593
|
|
|
594
|
+
def as_shallow_dict(self) -> dict:
|
|
595
|
+
"""Serializes the ListSubscriptionsResponse into a shallow dictionary of its immediate attributes."""
|
|
596
|
+
body = {}
|
|
597
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
598
|
+
if self.subscriptions: body['subscriptions'] = self.subscriptions
|
|
599
|
+
return body
|
|
600
|
+
|
|
460
601
|
@classmethod
|
|
461
602
|
def from_dict(cls, d: Dict[str, any]) -> ListSubscriptionsResponse:
|
|
462
603
|
"""Deserializes the ListSubscriptionsResponse from a dictionary."""
|
|
@@ -477,6 +618,13 @@ class MessageError:
|
|
|
477
618
|
if self.type is not None: body['type'] = self.type.value
|
|
478
619
|
return body
|
|
479
620
|
|
|
621
|
+
def as_shallow_dict(self) -> dict:
|
|
622
|
+
"""Serializes the MessageError into a shallow dictionary of its immediate attributes."""
|
|
623
|
+
body = {}
|
|
624
|
+
if self.error is not None: body['error'] = self.error
|
|
625
|
+
if self.type is not None: body['type'] = self.type
|
|
626
|
+
return body
|
|
627
|
+
|
|
480
628
|
@classmethod
|
|
481
629
|
def from_dict(cls, d: Dict[str, any]) -> MessageError:
|
|
482
630
|
"""Deserializes the MessageError from a dictionary."""
|
|
@@ -563,12 +711,28 @@ class MigrateDashboardRequest:
|
|
|
563
711
|
parent_path: Optional[str] = None
|
|
564
712
|
"""The workspace path of the folder to contain the migrated Lakeview dashboard."""
|
|
565
713
|
|
|
714
|
+
update_parameter_syntax: Optional[bool] = None
|
|
715
|
+
"""Flag to indicate if mustache parameter syntax ({{ param }}) should be auto-updated to named
|
|
716
|
+
syntax (:param) when converting datasets in the dashboard."""
|
|
717
|
+
|
|
566
718
|
def as_dict(self) -> dict:
|
|
567
719
|
"""Serializes the MigrateDashboardRequest into a dictionary suitable for use as a JSON request body."""
|
|
568
720
|
body = {}
|
|
569
721
|
if self.display_name is not None: body['display_name'] = self.display_name
|
|
570
722
|
if self.parent_path is not None: body['parent_path'] = self.parent_path
|
|
571
723
|
if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id
|
|
724
|
+
if self.update_parameter_syntax is not None:
|
|
725
|
+
body['update_parameter_syntax'] = self.update_parameter_syntax
|
|
726
|
+
return body
|
|
727
|
+
|
|
728
|
+
def as_shallow_dict(self) -> dict:
|
|
729
|
+
"""Serializes the MigrateDashboardRequest into a shallow dictionary of its immediate attributes."""
|
|
730
|
+
body = {}
|
|
731
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
732
|
+
if self.parent_path is not None: body['parent_path'] = self.parent_path
|
|
733
|
+
if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id
|
|
734
|
+
if self.update_parameter_syntax is not None:
|
|
735
|
+
body['update_parameter_syntax'] = self.update_parameter_syntax
|
|
572
736
|
return body
|
|
573
737
|
|
|
574
738
|
@classmethod
|
|
@@ -576,7 +740,8 @@ class MigrateDashboardRequest:
|
|
|
576
740
|
"""Deserializes the MigrateDashboardRequest from a dictionary."""
|
|
577
741
|
return cls(display_name=d.get('display_name', None),
|
|
578
742
|
parent_path=d.get('parent_path', None),
|
|
579
|
-
source_dashboard_id=d.get('source_dashboard_id', None)
|
|
743
|
+
source_dashboard_id=d.get('source_dashboard_id', None),
|
|
744
|
+
update_parameter_syntax=d.get('update_parameter_syntax', None))
|
|
580
745
|
|
|
581
746
|
|
|
582
747
|
@dataclass
|
|
@@ -599,6 +764,14 @@ class PublishRequest:
|
|
|
599
764
|
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
600
765
|
return body
|
|
601
766
|
|
|
767
|
+
def as_shallow_dict(self) -> dict:
|
|
768
|
+
"""Serializes the PublishRequest into a shallow dictionary of its immediate attributes."""
|
|
769
|
+
body = {}
|
|
770
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
771
|
+
if self.embed_credentials is not None: body['embed_credentials'] = self.embed_credentials
|
|
772
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
773
|
+
return body
|
|
774
|
+
|
|
602
775
|
@classmethod
|
|
603
776
|
def from_dict(cls, d: Dict[str, any]) -> PublishRequest:
|
|
604
777
|
"""Deserializes the PublishRequest from a dictionary."""
|
|
@@ -630,6 +803,15 @@ class PublishedDashboard:
|
|
|
630
803
|
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
631
804
|
return body
|
|
632
805
|
|
|
806
|
+
def as_shallow_dict(self) -> dict:
|
|
807
|
+
"""Serializes the PublishedDashboard into a shallow dictionary of its immediate attributes."""
|
|
808
|
+
body = {}
|
|
809
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
810
|
+
if self.embed_credentials is not None: body['embed_credentials'] = self.embed_credentials
|
|
811
|
+
if self.revision_create_time is not None: body['revision_create_time'] = self.revision_create_time
|
|
812
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
813
|
+
return body
|
|
814
|
+
|
|
633
815
|
@classmethod
|
|
634
816
|
def from_dict(cls, d: Dict[str, any]) -> PublishedDashboard:
|
|
635
817
|
"""Deserializes the PublishedDashboard from a dictionary."""
|
|
@@ -641,6 +823,8 @@ class PublishedDashboard:
|
|
|
641
823
|
|
|
642
824
|
@dataclass
|
|
643
825
|
class QueryAttachment:
|
|
826
|
+
cached_query_schema: Optional[QuerySchema] = None
|
|
827
|
+
|
|
644
828
|
description: Optional[str] = None
|
|
645
829
|
"""Description of the query"""
|
|
646
830
|
|
|
@@ -665,6 +849,21 @@ class QueryAttachment:
|
|
|
665
849
|
def as_dict(self) -> dict:
|
|
666
850
|
"""Serializes the QueryAttachment into a dictionary suitable for use as a JSON request body."""
|
|
667
851
|
body = {}
|
|
852
|
+
if self.cached_query_schema: body['cached_query_schema'] = self.cached_query_schema.as_dict()
|
|
853
|
+
if self.description is not None: body['description'] = self.description
|
|
854
|
+
if self.id is not None: body['id'] = self.id
|
|
855
|
+
if self.instruction_id is not None: body['instruction_id'] = self.instruction_id
|
|
856
|
+
if self.instruction_title is not None: body['instruction_title'] = self.instruction_title
|
|
857
|
+
if self.last_updated_timestamp is not None:
|
|
858
|
+
body['last_updated_timestamp'] = self.last_updated_timestamp
|
|
859
|
+
if self.query is not None: body['query'] = self.query
|
|
860
|
+
if self.title is not None: body['title'] = self.title
|
|
861
|
+
return body
|
|
862
|
+
|
|
863
|
+
def as_shallow_dict(self) -> dict:
|
|
864
|
+
"""Serializes the QueryAttachment into a shallow dictionary of its immediate attributes."""
|
|
865
|
+
body = {}
|
|
866
|
+
if self.cached_query_schema: body['cached_query_schema'] = self.cached_query_schema
|
|
668
867
|
if self.description is not None: body['description'] = self.description
|
|
669
868
|
if self.id is not None: body['id'] = self.id
|
|
670
869
|
if self.instruction_id is not None: body['instruction_id'] = self.instruction_id
|
|
@@ -678,7 +877,8 @@ class QueryAttachment:
|
|
|
678
877
|
@classmethod
|
|
679
878
|
def from_dict(cls, d: Dict[str, any]) -> QueryAttachment:
|
|
680
879
|
"""Deserializes the QueryAttachment from a dictionary."""
|
|
681
|
-
return cls(
|
|
880
|
+
return cls(cached_query_schema=_from_dict(d, 'cached_query_schema', QuerySchema),
|
|
881
|
+
description=d.get('description', None),
|
|
682
882
|
id=d.get('id', None),
|
|
683
883
|
instruction_id=d.get('instruction_id', None),
|
|
684
884
|
instruction_title=d.get('instruction_title', None),
|
|
@@ -687,6 +887,69 @@ class QueryAttachment:
|
|
|
687
887
|
title=d.get('title', None))
|
|
688
888
|
|
|
689
889
|
|
|
890
|
+
@dataclass
|
|
891
|
+
class QuerySchema:
|
|
892
|
+
columns: Optional[List[QuerySchemaColumn]] = None
|
|
893
|
+
|
|
894
|
+
statement_id: Optional[str] = None
|
|
895
|
+
"""Used to determine if the stored query schema is compatible with the latest run. The service
|
|
896
|
+
should always clear the schema when the query is re-executed."""
|
|
897
|
+
|
|
898
|
+
def as_dict(self) -> dict:
|
|
899
|
+
"""Serializes the QuerySchema into a dictionary suitable for use as a JSON request body."""
|
|
900
|
+
body = {}
|
|
901
|
+
if self.columns: body['columns'] = [v.as_dict() for v in self.columns]
|
|
902
|
+
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
903
|
+
return body
|
|
904
|
+
|
|
905
|
+
def as_shallow_dict(self) -> dict:
|
|
906
|
+
"""Serializes the QuerySchema into a shallow dictionary of its immediate attributes."""
|
|
907
|
+
body = {}
|
|
908
|
+
if self.columns: body['columns'] = self.columns
|
|
909
|
+
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
910
|
+
return body
|
|
911
|
+
|
|
912
|
+
@classmethod
|
|
913
|
+
def from_dict(cls, d: Dict[str, any]) -> QuerySchema:
|
|
914
|
+
"""Deserializes the QuerySchema from a dictionary."""
|
|
915
|
+
return cls(columns=_repeated_dict(d, 'columns', QuerySchemaColumn),
|
|
916
|
+
statement_id=d.get('statement_id', None))
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
@dataclass
|
|
920
|
+
class QuerySchemaColumn:
|
|
921
|
+
name: str
|
|
922
|
+
|
|
923
|
+
type_text: str
|
|
924
|
+
"""Corresponds to type desc"""
|
|
925
|
+
|
|
926
|
+
data_type: DataType
|
|
927
|
+
"""Populated from https://docs.databricks.com/sql/language-manual/sql-ref-datatypes.html"""
|
|
928
|
+
|
|
929
|
+
def as_dict(self) -> dict:
|
|
930
|
+
"""Serializes the QuerySchemaColumn into a dictionary suitable for use as a JSON request body."""
|
|
931
|
+
body = {}
|
|
932
|
+
if self.data_type is not None: body['data_type'] = self.data_type.value
|
|
933
|
+
if self.name is not None: body['name'] = self.name
|
|
934
|
+
if self.type_text is not None: body['type_text'] = self.type_text
|
|
935
|
+
return body
|
|
936
|
+
|
|
937
|
+
def as_shallow_dict(self) -> dict:
|
|
938
|
+
"""Serializes the QuerySchemaColumn into a shallow dictionary of its immediate attributes."""
|
|
939
|
+
body = {}
|
|
940
|
+
if self.data_type is not None: body['data_type'] = self.data_type
|
|
941
|
+
if self.name is not None: body['name'] = self.name
|
|
942
|
+
if self.type_text is not None: body['type_text'] = self.type_text
|
|
943
|
+
return body
|
|
944
|
+
|
|
945
|
+
@classmethod
|
|
946
|
+
def from_dict(cls, d: Dict[str, any]) -> QuerySchemaColumn:
|
|
947
|
+
"""Deserializes the QuerySchemaColumn from a dictionary."""
|
|
948
|
+
return cls(data_type=_enum(d, 'data_type', DataType),
|
|
949
|
+
name=d.get('name', None),
|
|
950
|
+
type_text=d.get('type_text', None))
|
|
951
|
+
|
|
952
|
+
|
|
690
953
|
@dataclass
|
|
691
954
|
class Result:
|
|
692
955
|
is_truncated: Optional[bool] = None
|
|
@@ -707,6 +970,14 @@ class Result:
|
|
|
707
970
|
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
708
971
|
return body
|
|
709
972
|
|
|
973
|
+
def as_shallow_dict(self) -> dict:
|
|
974
|
+
"""Serializes the Result into a shallow dictionary of its immediate attributes."""
|
|
975
|
+
body = {}
|
|
976
|
+
if self.is_truncated is not None: body['is_truncated'] = self.is_truncated
|
|
977
|
+
if self.row_count is not None: body['row_count'] = self.row_count
|
|
978
|
+
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
979
|
+
return body
|
|
980
|
+
|
|
710
981
|
@classmethod
|
|
711
982
|
def from_dict(cls, d: Dict[str, any]) -> Result:
|
|
712
983
|
"""Deserializes the Result from a dictionary."""
|
|
@@ -760,6 +1031,20 @@ class Schedule:
|
|
|
760
1031
|
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
761
1032
|
return body
|
|
762
1033
|
|
|
1034
|
+
def as_shallow_dict(self) -> dict:
|
|
1035
|
+
"""Serializes the Schedule into a shallow dictionary of its immediate attributes."""
|
|
1036
|
+
body = {}
|
|
1037
|
+
if self.create_time is not None: body['create_time'] = self.create_time
|
|
1038
|
+
if self.cron_schedule: body['cron_schedule'] = self.cron_schedule
|
|
1039
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
1040
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
1041
|
+
if self.etag is not None: body['etag'] = self.etag
|
|
1042
|
+
if self.pause_status is not None: body['pause_status'] = self.pause_status
|
|
1043
|
+
if self.schedule_id is not None: body['schedule_id'] = self.schedule_id
|
|
1044
|
+
if self.update_time is not None: body['update_time'] = self.update_time
|
|
1045
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
1046
|
+
return body
|
|
1047
|
+
|
|
763
1048
|
@classmethod
|
|
764
1049
|
def from_dict(cls, d: Dict[str, any]) -> Schedule:
|
|
765
1050
|
"""Deserializes the Schedule from a dictionary."""
|
|
@@ -797,6 +1082,13 @@ class Subscriber:
|
|
|
797
1082
|
if self.user_subscriber: body['user_subscriber'] = self.user_subscriber.as_dict()
|
|
798
1083
|
return body
|
|
799
1084
|
|
|
1085
|
+
def as_shallow_dict(self) -> dict:
|
|
1086
|
+
"""Serializes the Subscriber into a shallow dictionary of its immediate attributes."""
|
|
1087
|
+
body = {}
|
|
1088
|
+
if self.destination_subscriber: body['destination_subscriber'] = self.destination_subscriber
|
|
1089
|
+
if self.user_subscriber: body['user_subscriber'] = self.user_subscriber
|
|
1090
|
+
return body
|
|
1091
|
+
|
|
800
1092
|
@classmethod
|
|
801
1093
|
def from_dict(cls, d: Dict[str, any]) -> Subscriber:
|
|
802
1094
|
"""Deserializes the Subscriber from a dictionary."""
|
|
@@ -846,6 +1138,19 @@ class Subscription:
|
|
|
846
1138
|
if self.update_time is not None: body['update_time'] = self.update_time
|
|
847
1139
|
return body
|
|
848
1140
|
|
|
1141
|
+
def as_shallow_dict(self) -> dict:
|
|
1142
|
+
"""Serializes the Subscription into a shallow dictionary of its immediate attributes."""
|
|
1143
|
+
body = {}
|
|
1144
|
+
if self.create_time is not None: body['create_time'] = self.create_time
|
|
1145
|
+
if self.created_by_user_id is not None: body['created_by_user_id'] = self.created_by_user_id
|
|
1146
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
1147
|
+
if self.etag is not None: body['etag'] = self.etag
|
|
1148
|
+
if self.schedule_id is not None: body['schedule_id'] = self.schedule_id
|
|
1149
|
+
if self.subscriber: body['subscriber'] = self.subscriber
|
|
1150
|
+
if self.subscription_id is not None: body['subscription_id'] = self.subscription_id
|
|
1151
|
+
if self.update_time is not None: body['update_time'] = self.update_time
|
|
1152
|
+
return body
|
|
1153
|
+
|
|
849
1154
|
@classmethod
|
|
850
1155
|
def from_dict(cls, d: Dict[str, any]) -> Subscription:
|
|
851
1156
|
"""Deserializes the Subscription from a dictionary."""
|
|
@@ -870,6 +1175,12 @@ class SubscriptionSubscriberDestination:
|
|
|
870
1175
|
if self.destination_id is not None: body['destination_id'] = self.destination_id
|
|
871
1176
|
return body
|
|
872
1177
|
|
|
1178
|
+
def as_shallow_dict(self) -> dict:
|
|
1179
|
+
"""Serializes the SubscriptionSubscriberDestination into a shallow dictionary of its immediate attributes."""
|
|
1180
|
+
body = {}
|
|
1181
|
+
if self.destination_id is not None: body['destination_id'] = self.destination_id
|
|
1182
|
+
return body
|
|
1183
|
+
|
|
873
1184
|
@classmethod
|
|
874
1185
|
def from_dict(cls, d: Dict[str, any]) -> SubscriptionSubscriberDestination:
|
|
875
1186
|
"""Deserializes the SubscriptionSubscriberDestination from a dictionary."""
|
|
@@ -887,6 +1198,12 @@ class SubscriptionSubscriberUser:
|
|
|
887
1198
|
if self.user_id is not None: body['user_id'] = self.user_id
|
|
888
1199
|
return body
|
|
889
1200
|
|
|
1201
|
+
def as_shallow_dict(self) -> dict:
|
|
1202
|
+
"""Serializes the SubscriptionSubscriberUser into a shallow dictionary of its immediate attributes."""
|
|
1203
|
+
body = {}
|
|
1204
|
+
if self.user_id is not None: body['user_id'] = self.user_id
|
|
1205
|
+
return body
|
|
1206
|
+
|
|
890
1207
|
@classmethod
|
|
891
1208
|
def from_dict(cls, d: Dict[str, any]) -> SubscriptionSubscriberUser:
|
|
892
1209
|
"""Deserializes the SubscriptionSubscriberUser from a dictionary."""
|
|
@@ -907,6 +1224,13 @@ class TextAttachment:
|
|
|
907
1224
|
if self.id is not None: body['id'] = self.id
|
|
908
1225
|
return body
|
|
909
1226
|
|
|
1227
|
+
def as_shallow_dict(self) -> dict:
|
|
1228
|
+
"""Serializes the TextAttachment into a shallow dictionary of its immediate attributes."""
|
|
1229
|
+
body = {}
|
|
1230
|
+
if self.content is not None: body['content'] = self.content
|
|
1231
|
+
if self.id is not None: body['id'] = self.id
|
|
1232
|
+
return body
|
|
1233
|
+
|
|
910
1234
|
@classmethod
|
|
911
1235
|
def from_dict(cls, d: Dict[str, any]) -> TextAttachment:
|
|
912
1236
|
"""Deserializes the TextAttachment from a dictionary."""
|
|
@@ -921,6 +1245,11 @@ class TrashDashboardResponse:
|
|
|
921
1245
|
body = {}
|
|
922
1246
|
return body
|
|
923
1247
|
|
|
1248
|
+
def as_shallow_dict(self) -> dict:
|
|
1249
|
+
"""Serializes the TrashDashboardResponse into a shallow dictionary of its immediate attributes."""
|
|
1250
|
+
body = {}
|
|
1251
|
+
return body
|
|
1252
|
+
|
|
924
1253
|
@classmethod
|
|
925
1254
|
def from_dict(cls, d: Dict[str, any]) -> TrashDashboardResponse:
|
|
926
1255
|
"""Deserializes the TrashDashboardResponse from a dictionary."""
|
|
@@ -935,6 +1264,11 @@ class UnpublishDashboardResponse:
|
|
|
935
1264
|
body = {}
|
|
936
1265
|
return body
|
|
937
1266
|
|
|
1267
|
+
def as_shallow_dict(self) -> dict:
|
|
1268
|
+
"""Serializes the UnpublishDashboardResponse into a shallow dictionary of its immediate attributes."""
|
|
1269
|
+
body = {}
|
|
1270
|
+
return body
|
|
1271
|
+
|
|
938
1272
|
@classmethod
|
|
939
1273
|
def from_dict(cls, d: Dict[str, any]) -> UnpublishDashboardResponse:
|
|
940
1274
|
"""Deserializes the UnpublishDashboardResponse from a dictionary."""
|
|
@@ -1434,7 +1768,8 @@ class LakeviewAPI:
|
|
|
1434
1768
|
source_dashboard_id: str,
|
|
1435
1769
|
*,
|
|
1436
1770
|
display_name: Optional[str] = None,
|
|
1437
|
-
parent_path: Optional[str] = None
|
|
1771
|
+
parent_path: Optional[str] = None,
|
|
1772
|
+
update_parameter_syntax: Optional[bool] = None) -> Dashboard:
|
|
1438
1773
|
"""Migrate dashboard.
|
|
1439
1774
|
|
|
1440
1775
|
Migrates a classic SQL dashboard to Lakeview.
|
|
@@ -1445,6 +1780,9 @@ class LakeviewAPI:
|
|
|
1445
1780
|
Display name for the new Lakeview dashboard.
|
|
1446
1781
|
:param parent_path: str (optional)
|
|
1447
1782
|
The workspace path of the folder to contain the migrated Lakeview dashboard.
|
|
1783
|
+
:param update_parameter_syntax: bool (optional)
|
|
1784
|
+
Flag to indicate if mustache parameter syntax ({{ param }}) should be auto-updated to named syntax
|
|
1785
|
+
(:param) when converting datasets in the dashboard.
|
|
1448
1786
|
|
|
1449
1787
|
:returns: :class:`Dashboard`
|
|
1450
1788
|
"""
|
|
@@ -1452,6 +1790,7 @@ class LakeviewAPI:
|
|
|
1452
1790
|
if display_name is not None: body['display_name'] = display_name
|
|
1453
1791
|
if parent_path is not None: body['parent_path'] = parent_path
|
|
1454
1792
|
if source_dashboard_id is not None: body['source_dashboard_id'] = source_dashboard_id
|
|
1793
|
+
if update_parameter_syntax is not None: body['update_parameter_syntax'] = update_parameter_syntax
|
|
1455
1794
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1456
1795
|
|
|
1457
1796
|
res = self._api.do('POST', '/api/2.0/lakeview/dashboards/migrate', body=body, headers=headers)
|