databricks-sdk 0.37.0__py3-none-any.whl → 0.39.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 +24 -2
- databricks/sdk/_base_client.py +61 -14
- databricks/sdk/config.py +10 -9
- databricks/sdk/credentials_provider.py +6 -5
- databricks/sdk/mixins/jobs.py +49 -0
- databricks/sdk/mixins/open_ai_client.py +2 -2
- databricks/sdk/service/apps.py +185 -4
- databricks/sdk/service/billing.py +248 -1
- databricks/sdk/service/catalog.py +1943 -46
- databricks/sdk/service/cleanrooms.py +1281 -0
- databricks/sdk/service/compute.py +1486 -8
- databricks/sdk/service/dashboards.py +336 -11
- databricks/sdk/service/files.py +162 -2
- databricks/sdk/service/iam.py +353 -2
- databricks/sdk/service/jobs.py +1281 -16
- databricks/sdk/service/marketplace.py +688 -0
- databricks/sdk/service/ml.py +1038 -2
- databricks/sdk/service/oauth2.py +176 -0
- databricks/sdk/service/pipelines.py +602 -15
- databricks/sdk/service/provisioning.py +402 -0
- databricks/sdk/service/serving.py +615 -0
- databricks/sdk/service/settings.py +1190 -3
- databricks/sdk/service/sharing.py +328 -2
- databricks/sdk/service/sql.py +1186 -2
- databricks/sdk/service/vectorsearch.py +290 -0
- databricks/sdk/service/workspace.py +453 -1
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/METADATA +26 -26
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/RECORD +33 -31
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.37.0.dist-info → databricks_sdk-0.39.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."""
|
|
@@ -571,6 +719,14 @@ class MigrateDashboardRequest:
|
|
|
571
719
|
if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id
|
|
572
720
|
return body
|
|
573
721
|
|
|
722
|
+
def as_shallow_dict(self) -> dict:
|
|
723
|
+
"""Serializes the MigrateDashboardRequest into a shallow dictionary of its immediate attributes."""
|
|
724
|
+
body = {}
|
|
725
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
726
|
+
if self.parent_path is not None: body['parent_path'] = self.parent_path
|
|
727
|
+
if self.source_dashboard_id is not None: body['source_dashboard_id'] = self.source_dashboard_id
|
|
728
|
+
return body
|
|
729
|
+
|
|
574
730
|
@classmethod
|
|
575
731
|
def from_dict(cls, d: Dict[str, any]) -> MigrateDashboardRequest:
|
|
576
732
|
"""Deserializes the MigrateDashboardRequest from a dictionary."""
|
|
@@ -599,6 +755,14 @@ class PublishRequest:
|
|
|
599
755
|
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
600
756
|
return body
|
|
601
757
|
|
|
758
|
+
def as_shallow_dict(self) -> dict:
|
|
759
|
+
"""Serializes the PublishRequest into a shallow dictionary of its immediate attributes."""
|
|
760
|
+
body = {}
|
|
761
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
762
|
+
if self.embed_credentials is not None: body['embed_credentials'] = self.embed_credentials
|
|
763
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
764
|
+
return body
|
|
765
|
+
|
|
602
766
|
@classmethod
|
|
603
767
|
def from_dict(cls, d: Dict[str, any]) -> PublishRequest:
|
|
604
768
|
"""Deserializes the PublishRequest from a dictionary."""
|
|
@@ -630,6 +794,15 @@ class PublishedDashboard:
|
|
|
630
794
|
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
631
795
|
return body
|
|
632
796
|
|
|
797
|
+
def as_shallow_dict(self) -> dict:
|
|
798
|
+
"""Serializes the PublishedDashboard into a shallow dictionary of its immediate attributes."""
|
|
799
|
+
body = {}
|
|
800
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
801
|
+
if self.embed_credentials is not None: body['embed_credentials'] = self.embed_credentials
|
|
802
|
+
if self.revision_create_time is not None: body['revision_create_time'] = self.revision_create_time
|
|
803
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
804
|
+
return body
|
|
805
|
+
|
|
633
806
|
@classmethod
|
|
634
807
|
def from_dict(cls, d: Dict[str, any]) -> PublishedDashboard:
|
|
635
808
|
"""Deserializes the PublishedDashboard from a dictionary."""
|
|
@@ -641,6 +814,8 @@ class PublishedDashboard:
|
|
|
641
814
|
|
|
642
815
|
@dataclass
|
|
643
816
|
class QueryAttachment:
|
|
817
|
+
cached_query_schema: Optional[QuerySchema] = None
|
|
818
|
+
|
|
644
819
|
description: Optional[str] = None
|
|
645
820
|
"""Description of the query"""
|
|
646
821
|
|
|
@@ -665,6 +840,21 @@ class QueryAttachment:
|
|
|
665
840
|
def as_dict(self) -> dict:
|
|
666
841
|
"""Serializes the QueryAttachment into a dictionary suitable for use as a JSON request body."""
|
|
667
842
|
body = {}
|
|
843
|
+
if self.cached_query_schema: body['cached_query_schema'] = self.cached_query_schema.as_dict()
|
|
844
|
+
if self.description is not None: body['description'] = self.description
|
|
845
|
+
if self.id is not None: body['id'] = self.id
|
|
846
|
+
if self.instruction_id is not None: body['instruction_id'] = self.instruction_id
|
|
847
|
+
if self.instruction_title is not None: body['instruction_title'] = self.instruction_title
|
|
848
|
+
if self.last_updated_timestamp is not None:
|
|
849
|
+
body['last_updated_timestamp'] = self.last_updated_timestamp
|
|
850
|
+
if self.query is not None: body['query'] = self.query
|
|
851
|
+
if self.title is not None: body['title'] = self.title
|
|
852
|
+
return body
|
|
853
|
+
|
|
854
|
+
def as_shallow_dict(self) -> dict:
|
|
855
|
+
"""Serializes the QueryAttachment into a shallow dictionary of its immediate attributes."""
|
|
856
|
+
body = {}
|
|
857
|
+
if self.cached_query_schema: body['cached_query_schema'] = self.cached_query_schema
|
|
668
858
|
if self.description is not None: body['description'] = self.description
|
|
669
859
|
if self.id is not None: body['id'] = self.id
|
|
670
860
|
if self.instruction_id is not None: body['instruction_id'] = self.instruction_id
|
|
@@ -678,7 +868,8 @@ class QueryAttachment:
|
|
|
678
868
|
@classmethod
|
|
679
869
|
def from_dict(cls, d: Dict[str, any]) -> QueryAttachment:
|
|
680
870
|
"""Deserializes the QueryAttachment from a dictionary."""
|
|
681
|
-
return cls(
|
|
871
|
+
return cls(cached_query_schema=_from_dict(d, 'cached_query_schema', QuerySchema),
|
|
872
|
+
description=d.get('description', None),
|
|
682
873
|
id=d.get('id', None),
|
|
683
874
|
instruction_id=d.get('instruction_id', None),
|
|
684
875
|
instruction_title=d.get('instruction_title', None),
|
|
@@ -687,6 +878,69 @@ class QueryAttachment:
|
|
|
687
878
|
title=d.get('title', None))
|
|
688
879
|
|
|
689
880
|
|
|
881
|
+
@dataclass
|
|
882
|
+
class QuerySchema:
|
|
883
|
+
columns: Optional[List[QuerySchemaColumn]] = None
|
|
884
|
+
|
|
885
|
+
statement_id: Optional[str] = None
|
|
886
|
+
"""Used to determine if the stored query schema is compatible with the latest run. The service
|
|
887
|
+
should always clear the schema when the query is re-executed."""
|
|
888
|
+
|
|
889
|
+
def as_dict(self) -> dict:
|
|
890
|
+
"""Serializes the QuerySchema into a dictionary suitable for use as a JSON request body."""
|
|
891
|
+
body = {}
|
|
892
|
+
if self.columns: body['columns'] = [v.as_dict() for v in self.columns]
|
|
893
|
+
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
894
|
+
return body
|
|
895
|
+
|
|
896
|
+
def as_shallow_dict(self) -> dict:
|
|
897
|
+
"""Serializes the QuerySchema into a shallow dictionary of its immediate attributes."""
|
|
898
|
+
body = {}
|
|
899
|
+
if self.columns: body['columns'] = self.columns
|
|
900
|
+
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
901
|
+
return body
|
|
902
|
+
|
|
903
|
+
@classmethod
|
|
904
|
+
def from_dict(cls, d: Dict[str, any]) -> QuerySchema:
|
|
905
|
+
"""Deserializes the QuerySchema from a dictionary."""
|
|
906
|
+
return cls(columns=_repeated_dict(d, 'columns', QuerySchemaColumn),
|
|
907
|
+
statement_id=d.get('statement_id', None))
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
@dataclass
|
|
911
|
+
class QuerySchemaColumn:
|
|
912
|
+
name: str
|
|
913
|
+
|
|
914
|
+
type_text: str
|
|
915
|
+
"""Corresponds to type desc"""
|
|
916
|
+
|
|
917
|
+
data_type: DataType
|
|
918
|
+
"""Populated from https://docs.databricks.com/sql/language-manual/sql-ref-datatypes.html"""
|
|
919
|
+
|
|
920
|
+
def as_dict(self) -> dict:
|
|
921
|
+
"""Serializes the QuerySchemaColumn into a dictionary suitable for use as a JSON request body."""
|
|
922
|
+
body = {}
|
|
923
|
+
if self.data_type is not None: body['data_type'] = self.data_type.value
|
|
924
|
+
if self.name is not None: body['name'] = self.name
|
|
925
|
+
if self.type_text is not None: body['type_text'] = self.type_text
|
|
926
|
+
return body
|
|
927
|
+
|
|
928
|
+
def as_shallow_dict(self) -> dict:
|
|
929
|
+
"""Serializes the QuerySchemaColumn into a shallow dictionary of its immediate attributes."""
|
|
930
|
+
body = {}
|
|
931
|
+
if self.data_type is not None: body['data_type'] = self.data_type
|
|
932
|
+
if self.name is not None: body['name'] = self.name
|
|
933
|
+
if self.type_text is not None: body['type_text'] = self.type_text
|
|
934
|
+
return body
|
|
935
|
+
|
|
936
|
+
@classmethod
|
|
937
|
+
def from_dict(cls, d: Dict[str, any]) -> QuerySchemaColumn:
|
|
938
|
+
"""Deserializes the QuerySchemaColumn from a dictionary."""
|
|
939
|
+
return cls(data_type=_enum(d, 'data_type', DataType),
|
|
940
|
+
name=d.get('name', None),
|
|
941
|
+
type_text=d.get('type_text', None))
|
|
942
|
+
|
|
943
|
+
|
|
690
944
|
@dataclass
|
|
691
945
|
class Result:
|
|
692
946
|
is_truncated: Optional[bool] = None
|
|
@@ -707,6 +961,14 @@ class Result:
|
|
|
707
961
|
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
708
962
|
return body
|
|
709
963
|
|
|
964
|
+
def as_shallow_dict(self) -> dict:
|
|
965
|
+
"""Serializes the Result into a shallow dictionary of its immediate attributes."""
|
|
966
|
+
body = {}
|
|
967
|
+
if self.is_truncated is not None: body['is_truncated'] = self.is_truncated
|
|
968
|
+
if self.row_count is not None: body['row_count'] = self.row_count
|
|
969
|
+
if self.statement_id is not None: body['statement_id'] = self.statement_id
|
|
970
|
+
return body
|
|
971
|
+
|
|
710
972
|
@classmethod
|
|
711
973
|
def from_dict(cls, d: Dict[str, any]) -> Result:
|
|
712
974
|
"""Deserializes the Result from a dictionary."""
|
|
@@ -760,6 +1022,20 @@ class Schedule:
|
|
|
760
1022
|
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
761
1023
|
return body
|
|
762
1024
|
|
|
1025
|
+
def as_shallow_dict(self) -> dict:
|
|
1026
|
+
"""Serializes the Schedule into a shallow dictionary of its immediate attributes."""
|
|
1027
|
+
body = {}
|
|
1028
|
+
if self.create_time is not None: body['create_time'] = self.create_time
|
|
1029
|
+
if self.cron_schedule: body['cron_schedule'] = self.cron_schedule
|
|
1030
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
1031
|
+
if self.display_name is not None: body['display_name'] = self.display_name
|
|
1032
|
+
if self.etag is not None: body['etag'] = self.etag
|
|
1033
|
+
if self.pause_status is not None: body['pause_status'] = self.pause_status
|
|
1034
|
+
if self.schedule_id is not None: body['schedule_id'] = self.schedule_id
|
|
1035
|
+
if self.update_time is not None: body['update_time'] = self.update_time
|
|
1036
|
+
if self.warehouse_id is not None: body['warehouse_id'] = self.warehouse_id
|
|
1037
|
+
return body
|
|
1038
|
+
|
|
763
1039
|
@classmethod
|
|
764
1040
|
def from_dict(cls, d: Dict[str, any]) -> Schedule:
|
|
765
1041
|
"""Deserializes the Schedule from a dictionary."""
|
|
@@ -797,6 +1073,13 @@ class Subscriber:
|
|
|
797
1073
|
if self.user_subscriber: body['user_subscriber'] = self.user_subscriber.as_dict()
|
|
798
1074
|
return body
|
|
799
1075
|
|
|
1076
|
+
def as_shallow_dict(self) -> dict:
|
|
1077
|
+
"""Serializes the Subscriber into a shallow dictionary of its immediate attributes."""
|
|
1078
|
+
body = {}
|
|
1079
|
+
if self.destination_subscriber: body['destination_subscriber'] = self.destination_subscriber
|
|
1080
|
+
if self.user_subscriber: body['user_subscriber'] = self.user_subscriber
|
|
1081
|
+
return body
|
|
1082
|
+
|
|
800
1083
|
@classmethod
|
|
801
1084
|
def from_dict(cls, d: Dict[str, any]) -> Subscriber:
|
|
802
1085
|
"""Deserializes the Subscriber from a dictionary."""
|
|
@@ -846,6 +1129,19 @@ class Subscription:
|
|
|
846
1129
|
if self.update_time is not None: body['update_time'] = self.update_time
|
|
847
1130
|
return body
|
|
848
1131
|
|
|
1132
|
+
def as_shallow_dict(self) -> dict:
|
|
1133
|
+
"""Serializes the Subscription into a shallow dictionary of its immediate attributes."""
|
|
1134
|
+
body = {}
|
|
1135
|
+
if self.create_time is not None: body['create_time'] = self.create_time
|
|
1136
|
+
if self.created_by_user_id is not None: body['created_by_user_id'] = self.created_by_user_id
|
|
1137
|
+
if self.dashboard_id is not None: body['dashboard_id'] = self.dashboard_id
|
|
1138
|
+
if self.etag is not None: body['etag'] = self.etag
|
|
1139
|
+
if self.schedule_id is not None: body['schedule_id'] = self.schedule_id
|
|
1140
|
+
if self.subscriber: body['subscriber'] = self.subscriber
|
|
1141
|
+
if self.subscription_id is not None: body['subscription_id'] = self.subscription_id
|
|
1142
|
+
if self.update_time is not None: body['update_time'] = self.update_time
|
|
1143
|
+
return body
|
|
1144
|
+
|
|
849
1145
|
@classmethod
|
|
850
1146
|
def from_dict(cls, d: Dict[str, any]) -> Subscription:
|
|
851
1147
|
"""Deserializes the Subscription from a dictionary."""
|
|
@@ -870,6 +1166,12 @@ class SubscriptionSubscriberDestination:
|
|
|
870
1166
|
if self.destination_id is not None: body['destination_id'] = self.destination_id
|
|
871
1167
|
return body
|
|
872
1168
|
|
|
1169
|
+
def as_shallow_dict(self) -> dict:
|
|
1170
|
+
"""Serializes the SubscriptionSubscriberDestination into a shallow dictionary of its immediate attributes."""
|
|
1171
|
+
body = {}
|
|
1172
|
+
if self.destination_id is not None: body['destination_id'] = self.destination_id
|
|
1173
|
+
return body
|
|
1174
|
+
|
|
873
1175
|
@classmethod
|
|
874
1176
|
def from_dict(cls, d: Dict[str, any]) -> SubscriptionSubscriberDestination:
|
|
875
1177
|
"""Deserializes the SubscriptionSubscriberDestination from a dictionary."""
|
|
@@ -887,6 +1189,12 @@ class SubscriptionSubscriberUser:
|
|
|
887
1189
|
if self.user_id is not None: body['user_id'] = self.user_id
|
|
888
1190
|
return body
|
|
889
1191
|
|
|
1192
|
+
def as_shallow_dict(self) -> dict:
|
|
1193
|
+
"""Serializes the SubscriptionSubscriberUser into a shallow dictionary of its immediate attributes."""
|
|
1194
|
+
body = {}
|
|
1195
|
+
if self.user_id is not None: body['user_id'] = self.user_id
|
|
1196
|
+
return body
|
|
1197
|
+
|
|
890
1198
|
@classmethod
|
|
891
1199
|
def from_dict(cls, d: Dict[str, any]) -> SubscriptionSubscriberUser:
|
|
892
1200
|
"""Deserializes the SubscriptionSubscriberUser from a dictionary."""
|
|
@@ -907,6 +1215,13 @@ class TextAttachment:
|
|
|
907
1215
|
if self.id is not None: body['id'] = self.id
|
|
908
1216
|
return body
|
|
909
1217
|
|
|
1218
|
+
def as_shallow_dict(self) -> dict:
|
|
1219
|
+
"""Serializes the TextAttachment into a shallow dictionary of its immediate attributes."""
|
|
1220
|
+
body = {}
|
|
1221
|
+
if self.content is not None: body['content'] = self.content
|
|
1222
|
+
if self.id is not None: body['id'] = self.id
|
|
1223
|
+
return body
|
|
1224
|
+
|
|
910
1225
|
@classmethod
|
|
911
1226
|
def from_dict(cls, d: Dict[str, any]) -> TextAttachment:
|
|
912
1227
|
"""Deserializes the TextAttachment from a dictionary."""
|
|
@@ -921,6 +1236,11 @@ class TrashDashboardResponse:
|
|
|
921
1236
|
body = {}
|
|
922
1237
|
return body
|
|
923
1238
|
|
|
1239
|
+
def as_shallow_dict(self) -> dict:
|
|
1240
|
+
"""Serializes the TrashDashboardResponse into a shallow dictionary of its immediate attributes."""
|
|
1241
|
+
body = {}
|
|
1242
|
+
return body
|
|
1243
|
+
|
|
924
1244
|
@classmethod
|
|
925
1245
|
def from_dict(cls, d: Dict[str, any]) -> TrashDashboardResponse:
|
|
926
1246
|
"""Deserializes the TrashDashboardResponse from a dictionary."""
|
|
@@ -935,6 +1255,11 @@ class UnpublishDashboardResponse:
|
|
|
935
1255
|
body = {}
|
|
936
1256
|
return body
|
|
937
1257
|
|
|
1258
|
+
def as_shallow_dict(self) -> dict:
|
|
1259
|
+
"""Serializes the UnpublishDashboardResponse into a shallow dictionary of its immediate attributes."""
|
|
1260
|
+
body = {}
|
|
1261
|
+
return body
|
|
1262
|
+
|
|
938
1263
|
@classmethod
|
|
939
1264
|
def from_dict(cls, d: Dict[str, any]) -> UnpublishDashboardResponse:
|
|
940
1265
|
"""Deserializes the UnpublishDashboardResponse from a dictionary."""
|
|
@@ -1144,7 +1469,7 @@ class LakeviewAPI:
|
|
|
1144
1469
|
|
|
1145
1470
|
:returns: :class:`Dashboard`
|
|
1146
1471
|
"""
|
|
1147
|
-
body = dashboard
|
|
1472
|
+
body = dashboard.as_dict()
|
|
1148
1473
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1149
1474
|
|
|
1150
1475
|
res = self._api.do('POST', '/api/2.0/lakeview/dashboards', body=body, headers=headers)
|
|
@@ -1159,7 +1484,7 @@ class LakeviewAPI:
|
|
|
1159
1484
|
|
|
1160
1485
|
:returns: :class:`Schedule`
|
|
1161
1486
|
"""
|
|
1162
|
-
body = schedule
|
|
1487
|
+
body = schedule.as_dict()
|
|
1163
1488
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1164
1489
|
|
|
1165
1490
|
res = self._api.do('POST',
|
|
@@ -1183,7 +1508,7 @@ class LakeviewAPI:
|
|
|
1183
1508
|
|
|
1184
1509
|
:returns: :class:`Subscription`
|
|
1185
1510
|
"""
|
|
1186
|
-
body = subscription
|
|
1511
|
+
body = subscription.as_dict()
|
|
1187
1512
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1188
1513
|
|
|
1189
1514
|
res = self._api.do(
|
|
@@ -1269,7 +1594,7 @@ class LakeviewAPI:
|
|
|
1269
1594
|
Get the current published dashboard.
|
|
1270
1595
|
|
|
1271
1596
|
:param dashboard_id: str
|
|
1272
|
-
UUID identifying the dashboard
|
|
1597
|
+
UUID identifying the published dashboard.
|
|
1273
1598
|
|
|
1274
1599
|
:returns: :class:`PublishedDashboard`
|
|
1275
1600
|
"""
|
|
@@ -1364,7 +1689,7 @@ class LakeviewAPI:
|
|
|
1364
1689
|
"""List dashboard schedules.
|
|
1365
1690
|
|
|
1366
1691
|
:param dashboard_id: str
|
|
1367
|
-
UUID identifying the dashboard to which the
|
|
1692
|
+
UUID identifying the dashboard to which the schedules belongs.
|
|
1368
1693
|
:param page_size: int (optional)
|
|
1369
1694
|
The number of schedules to return per page.
|
|
1370
1695
|
:param page_token: str (optional)
|
|
@@ -1400,9 +1725,9 @@ class LakeviewAPI:
|
|
|
1400
1725
|
"""List schedule subscriptions.
|
|
1401
1726
|
|
|
1402
1727
|
:param dashboard_id: str
|
|
1403
|
-
UUID identifying the dashboard
|
|
1728
|
+
UUID identifying the dashboard which the subscriptions belongs.
|
|
1404
1729
|
:param schedule_id: str
|
|
1405
|
-
UUID identifying the schedule
|
|
1730
|
+
UUID identifying the schedule which the subscriptions belongs.
|
|
1406
1731
|
:param page_size: int (optional)
|
|
1407
1732
|
The number of subscriptions to return per page.
|
|
1408
1733
|
:param page_token: str (optional)
|
|
@@ -1508,7 +1833,7 @@ class LakeviewAPI:
|
|
|
1508
1833
|
Unpublish the dashboard.
|
|
1509
1834
|
|
|
1510
1835
|
:param dashboard_id: str
|
|
1511
|
-
UUID identifying the dashboard
|
|
1836
|
+
UUID identifying the published dashboard.
|
|
1512
1837
|
|
|
1513
1838
|
|
|
1514
1839
|
"""
|
|
@@ -1528,7 +1853,7 @@ class LakeviewAPI:
|
|
|
1528
1853
|
|
|
1529
1854
|
:returns: :class:`Dashboard`
|
|
1530
1855
|
"""
|
|
1531
|
-
body = dashboard
|
|
1856
|
+
body = dashboard.as_dict()
|
|
1532
1857
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1533
1858
|
|
|
1534
1859
|
res = self._api.do('PATCH',
|
|
@@ -1552,7 +1877,7 @@ class LakeviewAPI:
|
|
|
1552
1877
|
|
|
1553
1878
|
:returns: :class:`Schedule`
|
|
1554
1879
|
"""
|
|
1555
|
-
body = schedule
|
|
1880
|
+
body = schedule.as_dict()
|
|
1556
1881
|
headers = {'Accept': 'application/json', 'Content-Type': 'application/json', }
|
|
1557
1882
|
|
|
1558
1883
|
res = self._api.do('PUT',
|