databricks-sdk 0.57.0__py3-none-any.whl → 0.59.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 +38 -9
- databricks/sdk/service/aibuilder.py +0 -163
- databricks/sdk/service/apps.py +53 -49
- databricks/sdk/service/billing.py +62 -223
- databricks/sdk/service/catalog.py +3052 -3707
- databricks/sdk/service/cleanrooms.py +5 -54
- databricks/sdk/service/compute.py +579 -2715
- databricks/sdk/service/dashboards.py +108 -317
- databricks/sdk/service/database.py +603 -122
- databricks/sdk/service/files.py +2 -218
- databricks/sdk/service/iam.py +19 -298
- databricks/sdk/service/jobs.py +77 -1263
- databricks/sdk/service/marketplace.py +3 -575
- databricks/sdk/service/ml.py +816 -2734
- databricks/sdk/service/oauth2.py +122 -238
- databricks/sdk/service/pipelines.py +133 -724
- databricks/sdk/service/provisioning.py +36 -757
- databricks/sdk/service/qualitymonitorv2.py +0 -18
- databricks/sdk/service/serving.py +37 -583
- databricks/sdk/service/settings.py +282 -1768
- databricks/sdk/service/sharing.py +6 -478
- databricks/sdk/service/sql.py +129 -1696
- databricks/sdk/service/vectorsearch.py +0 -410
- databricks/sdk/service/workspace.py +252 -727
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/METADATA +1 -1
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/RECORD +31 -31
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/WHEEL +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/licenses/LICENSE +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/licenses/NOTICE +0 -0
- {databricks_sdk-0.57.0.dist-info → databricks_sdk-0.59.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/sql.py
CHANGED
|
@@ -665,7 +665,9 @@ class AlertV2:
|
|
|
665
665
|
"""Text of the query to be run."""
|
|
666
666
|
|
|
667
667
|
run_as_user_name: Optional[str] = None
|
|
668
|
-
"""The run as username
|
|
668
|
+
"""The run as username or application ID of service principal. On Create and Update, this field can
|
|
669
|
+
be set to application ID of an active service principal. Setting this field requires the
|
|
670
|
+
servicePrincipal/user role."""
|
|
669
671
|
|
|
670
672
|
schedule: Optional[CronSchedule] = None
|
|
671
673
|
|
|
@@ -1371,101 +1373,6 @@ class ComparisonOperator(Enum):
|
|
|
1371
1373
|
NOT_EQUAL = "NOT_EQUAL"
|
|
1372
1374
|
|
|
1373
1375
|
|
|
1374
|
-
@dataclass
|
|
1375
|
-
class CreateAlert:
|
|
1376
|
-
name: str
|
|
1377
|
-
"""Name of the alert."""
|
|
1378
|
-
|
|
1379
|
-
options: AlertOptions
|
|
1380
|
-
"""Alert configuration options."""
|
|
1381
|
-
|
|
1382
|
-
query_id: str
|
|
1383
|
-
"""Query ID."""
|
|
1384
|
-
|
|
1385
|
-
parent: Optional[str] = None
|
|
1386
|
-
"""The identifier of the workspace folder containing the object."""
|
|
1387
|
-
|
|
1388
|
-
rearm: Optional[int] = None
|
|
1389
|
-
"""Number of seconds after being triggered before the alert rearms itself and can be triggered
|
|
1390
|
-
again. If `null`, alert will never be triggered again."""
|
|
1391
|
-
|
|
1392
|
-
def as_dict(self) -> dict:
|
|
1393
|
-
"""Serializes the CreateAlert into a dictionary suitable for use as a JSON request body."""
|
|
1394
|
-
body = {}
|
|
1395
|
-
if self.name is not None:
|
|
1396
|
-
body["name"] = self.name
|
|
1397
|
-
if self.options:
|
|
1398
|
-
body["options"] = self.options.as_dict()
|
|
1399
|
-
if self.parent is not None:
|
|
1400
|
-
body["parent"] = self.parent
|
|
1401
|
-
if self.query_id is not None:
|
|
1402
|
-
body["query_id"] = self.query_id
|
|
1403
|
-
if self.rearm is not None:
|
|
1404
|
-
body["rearm"] = self.rearm
|
|
1405
|
-
return body
|
|
1406
|
-
|
|
1407
|
-
def as_shallow_dict(self) -> dict:
|
|
1408
|
-
"""Serializes the CreateAlert into a shallow dictionary of its immediate attributes."""
|
|
1409
|
-
body = {}
|
|
1410
|
-
if self.name is not None:
|
|
1411
|
-
body["name"] = self.name
|
|
1412
|
-
if self.options:
|
|
1413
|
-
body["options"] = self.options
|
|
1414
|
-
if self.parent is not None:
|
|
1415
|
-
body["parent"] = self.parent
|
|
1416
|
-
if self.query_id is not None:
|
|
1417
|
-
body["query_id"] = self.query_id
|
|
1418
|
-
if self.rearm is not None:
|
|
1419
|
-
body["rearm"] = self.rearm
|
|
1420
|
-
return body
|
|
1421
|
-
|
|
1422
|
-
@classmethod
|
|
1423
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateAlert:
|
|
1424
|
-
"""Deserializes the CreateAlert from a dictionary."""
|
|
1425
|
-
return cls(
|
|
1426
|
-
name=d.get("name", None),
|
|
1427
|
-
options=_from_dict(d, "options", AlertOptions),
|
|
1428
|
-
parent=d.get("parent", None),
|
|
1429
|
-
query_id=d.get("query_id", None),
|
|
1430
|
-
rearm=d.get("rearm", None),
|
|
1431
|
-
)
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
@dataclass
|
|
1435
|
-
class CreateAlertRequest:
|
|
1436
|
-
alert: Optional[CreateAlertRequestAlert] = None
|
|
1437
|
-
|
|
1438
|
-
auto_resolve_display_name: Optional[bool] = None
|
|
1439
|
-
"""If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
|
|
1440
|
-
alert's display name conflicts with an existing alert's display name."""
|
|
1441
|
-
|
|
1442
|
-
def as_dict(self) -> dict:
|
|
1443
|
-
"""Serializes the CreateAlertRequest into a dictionary suitable for use as a JSON request body."""
|
|
1444
|
-
body = {}
|
|
1445
|
-
if self.alert:
|
|
1446
|
-
body["alert"] = self.alert.as_dict()
|
|
1447
|
-
if self.auto_resolve_display_name is not None:
|
|
1448
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1449
|
-
return body
|
|
1450
|
-
|
|
1451
|
-
def as_shallow_dict(self) -> dict:
|
|
1452
|
-
"""Serializes the CreateAlertRequest into a shallow dictionary of its immediate attributes."""
|
|
1453
|
-
body = {}
|
|
1454
|
-
if self.alert:
|
|
1455
|
-
body["alert"] = self.alert
|
|
1456
|
-
if self.auto_resolve_display_name is not None:
|
|
1457
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1458
|
-
return body
|
|
1459
|
-
|
|
1460
|
-
@classmethod
|
|
1461
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateAlertRequest:
|
|
1462
|
-
"""Deserializes the CreateAlertRequest from a dictionary."""
|
|
1463
|
-
return cls(
|
|
1464
|
-
alert=_from_dict(d, "alert", CreateAlertRequestAlert),
|
|
1465
|
-
auto_resolve_display_name=d.get("auto_resolve_display_name", None),
|
|
1466
|
-
)
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
1376
|
@dataclass
|
|
1470
1377
|
class CreateAlertRequestAlert:
|
|
1471
1378
|
condition: Optional[AlertCondition] = None
|
|
@@ -1555,41 +1462,6 @@ class CreateAlertRequestAlert:
|
|
|
1555
1462
|
)
|
|
1556
1463
|
|
|
1557
1464
|
|
|
1558
|
-
@dataclass
|
|
1559
|
-
class CreateQueryRequest:
|
|
1560
|
-
auto_resolve_display_name: Optional[bool] = None
|
|
1561
|
-
"""If true, automatically resolve query display name conflicts. Otherwise, fail the request if the
|
|
1562
|
-
query's display name conflicts with an existing query's display name."""
|
|
1563
|
-
|
|
1564
|
-
query: Optional[CreateQueryRequestQuery] = None
|
|
1565
|
-
|
|
1566
|
-
def as_dict(self) -> dict:
|
|
1567
|
-
"""Serializes the CreateQueryRequest into a dictionary suitable for use as a JSON request body."""
|
|
1568
|
-
body = {}
|
|
1569
|
-
if self.auto_resolve_display_name is not None:
|
|
1570
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1571
|
-
if self.query:
|
|
1572
|
-
body["query"] = self.query.as_dict()
|
|
1573
|
-
return body
|
|
1574
|
-
|
|
1575
|
-
def as_shallow_dict(self) -> dict:
|
|
1576
|
-
"""Serializes the CreateQueryRequest into a shallow dictionary of its immediate attributes."""
|
|
1577
|
-
body = {}
|
|
1578
|
-
if self.auto_resolve_display_name is not None:
|
|
1579
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
1580
|
-
if self.query:
|
|
1581
|
-
body["query"] = self.query
|
|
1582
|
-
return body
|
|
1583
|
-
|
|
1584
|
-
@classmethod
|
|
1585
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateQueryRequest:
|
|
1586
|
-
"""Deserializes the CreateQueryRequest from a dictionary."""
|
|
1587
|
-
return cls(
|
|
1588
|
-
auto_resolve_display_name=d.get("auto_resolve_display_name", None),
|
|
1589
|
-
query=_from_dict(d, "query", CreateQueryRequestQuery),
|
|
1590
|
-
)
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
1465
|
@dataclass
|
|
1594
1466
|
class CreateQueryRequestQuery:
|
|
1595
1467
|
apply_auto_limit: Optional[bool] = None
|
|
@@ -1696,92 +1568,6 @@ class CreateQueryRequestQuery:
|
|
|
1696
1568
|
)
|
|
1697
1569
|
|
|
1698
1570
|
|
|
1699
|
-
@dataclass
|
|
1700
|
-
class CreateQueryVisualizationsLegacyRequest:
|
|
1701
|
-
"""Add visualization to a query"""
|
|
1702
|
-
|
|
1703
|
-
query_id: str
|
|
1704
|
-
"""The identifier returned by :method:queries/create"""
|
|
1705
|
-
|
|
1706
|
-
type: str
|
|
1707
|
-
"""The type of visualization: chart, table, pivot table, and so on."""
|
|
1708
|
-
|
|
1709
|
-
options: Any
|
|
1710
|
-
"""The options object varies widely from one visualization type to the next and is unsupported.
|
|
1711
|
-
Databricks does not recommend modifying visualization settings in JSON."""
|
|
1712
|
-
|
|
1713
|
-
description: Optional[str] = None
|
|
1714
|
-
"""A short description of this visualization. This is not displayed in the UI."""
|
|
1715
|
-
|
|
1716
|
-
name: Optional[str] = None
|
|
1717
|
-
"""The name of the visualization that appears on dashboards and the query screen."""
|
|
1718
|
-
|
|
1719
|
-
def as_dict(self) -> dict:
|
|
1720
|
-
"""Serializes the CreateQueryVisualizationsLegacyRequest into a dictionary suitable for use as a JSON request body."""
|
|
1721
|
-
body = {}
|
|
1722
|
-
if self.description is not None:
|
|
1723
|
-
body["description"] = self.description
|
|
1724
|
-
if self.name is not None:
|
|
1725
|
-
body["name"] = self.name
|
|
1726
|
-
if self.options:
|
|
1727
|
-
body["options"] = self.options
|
|
1728
|
-
if self.query_id is not None:
|
|
1729
|
-
body["query_id"] = self.query_id
|
|
1730
|
-
if self.type is not None:
|
|
1731
|
-
body["type"] = self.type
|
|
1732
|
-
return body
|
|
1733
|
-
|
|
1734
|
-
def as_shallow_dict(self) -> dict:
|
|
1735
|
-
"""Serializes the CreateQueryVisualizationsLegacyRequest into a shallow dictionary of its immediate attributes."""
|
|
1736
|
-
body = {}
|
|
1737
|
-
if self.description is not None:
|
|
1738
|
-
body["description"] = self.description
|
|
1739
|
-
if self.name is not None:
|
|
1740
|
-
body["name"] = self.name
|
|
1741
|
-
if self.options:
|
|
1742
|
-
body["options"] = self.options
|
|
1743
|
-
if self.query_id is not None:
|
|
1744
|
-
body["query_id"] = self.query_id
|
|
1745
|
-
if self.type is not None:
|
|
1746
|
-
body["type"] = self.type
|
|
1747
|
-
return body
|
|
1748
|
-
|
|
1749
|
-
@classmethod
|
|
1750
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateQueryVisualizationsLegacyRequest:
|
|
1751
|
-
"""Deserializes the CreateQueryVisualizationsLegacyRequest from a dictionary."""
|
|
1752
|
-
return cls(
|
|
1753
|
-
description=d.get("description", None),
|
|
1754
|
-
name=d.get("name", None),
|
|
1755
|
-
options=d.get("options", None),
|
|
1756
|
-
query_id=d.get("query_id", None),
|
|
1757
|
-
type=d.get("type", None),
|
|
1758
|
-
)
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
@dataclass
|
|
1762
|
-
class CreateVisualizationRequest:
|
|
1763
|
-
visualization: Optional[CreateVisualizationRequestVisualization] = None
|
|
1764
|
-
|
|
1765
|
-
def as_dict(self) -> dict:
|
|
1766
|
-
"""Serializes the CreateVisualizationRequest into a dictionary suitable for use as a JSON request body."""
|
|
1767
|
-
body = {}
|
|
1768
|
-
if self.visualization:
|
|
1769
|
-
body["visualization"] = self.visualization.as_dict()
|
|
1770
|
-
return body
|
|
1771
|
-
|
|
1772
|
-
def as_shallow_dict(self) -> dict:
|
|
1773
|
-
"""Serializes the CreateVisualizationRequest into a shallow dictionary of its immediate attributes."""
|
|
1774
|
-
body = {}
|
|
1775
|
-
if self.visualization:
|
|
1776
|
-
body["visualization"] = self.visualization
|
|
1777
|
-
return body
|
|
1778
|
-
|
|
1779
|
-
@classmethod
|
|
1780
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateVisualizationRequest:
|
|
1781
|
-
"""Deserializes the CreateVisualizationRequest from a dictionary."""
|
|
1782
|
-
return cls(visualization=_from_dict(d, "visualization", CreateVisualizationRequestVisualization))
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
1571
|
@dataclass
|
|
1786
1572
|
class CreateVisualizationRequestVisualization:
|
|
1787
1573
|
display_name: Optional[str] = None
|
|
@@ -1843,159 +1629,6 @@ class CreateVisualizationRequestVisualization:
|
|
|
1843
1629
|
)
|
|
1844
1630
|
|
|
1845
1631
|
|
|
1846
|
-
@dataclass
|
|
1847
|
-
class CreateWarehouseRequest:
|
|
1848
|
-
auto_stop_mins: Optional[int] = None
|
|
1849
|
-
"""The amount of time in minutes that a SQL warehouse must be idle (i.e., no RUNNING queries)
|
|
1850
|
-
before it is automatically stopped.
|
|
1851
|
-
|
|
1852
|
-
Supported values: - Must be >= 0 mins for serverless warehouses - Must be == 0 or >= 10 mins for
|
|
1853
|
-
non-serverless warehouses - 0 indicates no autostop.
|
|
1854
|
-
|
|
1855
|
-
Defaults to 120 mins"""
|
|
1856
|
-
|
|
1857
|
-
channel: Optional[Channel] = None
|
|
1858
|
-
"""Channel Details"""
|
|
1859
|
-
|
|
1860
|
-
cluster_size: Optional[str] = None
|
|
1861
|
-
"""Size of the clusters allocated for this warehouse. Increasing the size of a spark cluster allows
|
|
1862
|
-
you to run larger queries on it. If you want to increase the number of concurrent queries,
|
|
1863
|
-
please tune max_num_clusters.
|
|
1864
|
-
|
|
1865
|
-
Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large - 2X-Large - 3X-Large
|
|
1866
|
-
- 4X-Large"""
|
|
1867
|
-
|
|
1868
|
-
creator_name: Optional[str] = None
|
|
1869
|
-
"""warehouse creator name"""
|
|
1870
|
-
|
|
1871
|
-
enable_photon: Optional[bool] = None
|
|
1872
|
-
"""Configures whether the warehouse should use Photon optimized clusters.
|
|
1873
|
-
|
|
1874
|
-
Defaults to false."""
|
|
1875
|
-
|
|
1876
|
-
enable_serverless_compute: Optional[bool] = None
|
|
1877
|
-
"""Configures whether the warehouse should use serverless compute"""
|
|
1878
|
-
|
|
1879
|
-
instance_profile_arn: Optional[str] = None
|
|
1880
|
-
"""Deprecated. Instance profile used to pass IAM role to the cluster"""
|
|
1881
|
-
|
|
1882
|
-
max_num_clusters: Optional[int] = None
|
|
1883
|
-
"""Maximum number of clusters that the autoscaler will create to handle concurrent queries.
|
|
1884
|
-
|
|
1885
|
-
Supported values: - Must be >= min_num_clusters - Must be <= 30.
|
|
1886
|
-
|
|
1887
|
-
Defaults to min_clusters if unset."""
|
|
1888
|
-
|
|
1889
|
-
min_num_clusters: Optional[int] = None
|
|
1890
|
-
"""Minimum number of available clusters that will be maintained for this SQL warehouse. Increasing
|
|
1891
|
-
this will ensure that a larger number of clusters are always running and therefore may reduce
|
|
1892
|
-
the cold start time for new queries. This is similar to reserved vs. revocable cores in a
|
|
1893
|
-
resource manager.
|
|
1894
|
-
|
|
1895
|
-
Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30)
|
|
1896
|
-
|
|
1897
|
-
Defaults to 1"""
|
|
1898
|
-
|
|
1899
|
-
name: Optional[str] = None
|
|
1900
|
-
"""Logical name for the cluster.
|
|
1901
|
-
|
|
1902
|
-
Supported values: - Must be unique within an org. - Must be less than 100 characters."""
|
|
1903
|
-
|
|
1904
|
-
spot_instance_policy: Optional[SpotInstancePolicy] = None
|
|
1905
|
-
"""Configurations whether the warehouse should use spot instances."""
|
|
1906
|
-
|
|
1907
|
-
tags: Optional[EndpointTags] = None
|
|
1908
|
-
"""A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS
|
|
1909
|
-
volumes) associated with this SQL warehouse.
|
|
1910
|
-
|
|
1911
|
-
Supported values: - Number of tags < 45."""
|
|
1912
|
-
|
|
1913
|
-
warehouse_type: Optional[CreateWarehouseRequestWarehouseType] = None
|
|
1914
|
-
"""Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, you must set to `PRO`
|
|
1915
|
-
and also set the field `enable_serverless_compute` to `true`."""
|
|
1916
|
-
|
|
1917
|
-
def as_dict(self) -> dict:
|
|
1918
|
-
"""Serializes the CreateWarehouseRequest into a dictionary suitable for use as a JSON request body."""
|
|
1919
|
-
body = {}
|
|
1920
|
-
if self.auto_stop_mins is not None:
|
|
1921
|
-
body["auto_stop_mins"] = self.auto_stop_mins
|
|
1922
|
-
if self.channel:
|
|
1923
|
-
body["channel"] = self.channel.as_dict()
|
|
1924
|
-
if self.cluster_size is not None:
|
|
1925
|
-
body["cluster_size"] = self.cluster_size
|
|
1926
|
-
if self.creator_name is not None:
|
|
1927
|
-
body["creator_name"] = self.creator_name
|
|
1928
|
-
if self.enable_photon is not None:
|
|
1929
|
-
body["enable_photon"] = self.enable_photon
|
|
1930
|
-
if self.enable_serverless_compute is not None:
|
|
1931
|
-
body["enable_serverless_compute"] = self.enable_serverless_compute
|
|
1932
|
-
if self.instance_profile_arn is not None:
|
|
1933
|
-
body["instance_profile_arn"] = self.instance_profile_arn
|
|
1934
|
-
if self.max_num_clusters is not None:
|
|
1935
|
-
body["max_num_clusters"] = self.max_num_clusters
|
|
1936
|
-
if self.min_num_clusters is not None:
|
|
1937
|
-
body["min_num_clusters"] = self.min_num_clusters
|
|
1938
|
-
if self.name is not None:
|
|
1939
|
-
body["name"] = self.name
|
|
1940
|
-
if self.spot_instance_policy is not None:
|
|
1941
|
-
body["spot_instance_policy"] = self.spot_instance_policy.value
|
|
1942
|
-
if self.tags:
|
|
1943
|
-
body["tags"] = self.tags.as_dict()
|
|
1944
|
-
if self.warehouse_type is not None:
|
|
1945
|
-
body["warehouse_type"] = self.warehouse_type.value
|
|
1946
|
-
return body
|
|
1947
|
-
|
|
1948
|
-
def as_shallow_dict(self) -> dict:
|
|
1949
|
-
"""Serializes the CreateWarehouseRequest into a shallow dictionary of its immediate attributes."""
|
|
1950
|
-
body = {}
|
|
1951
|
-
if self.auto_stop_mins is not None:
|
|
1952
|
-
body["auto_stop_mins"] = self.auto_stop_mins
|
|
1953
|
-
if self.channel:
|
|
1954
|
-
body["channel"] = self.channel
|
|
1955
|
-
if self.cluster_size is not None:
|
|
1956
|
-
body["cluster_size"] = self.cluster_size
|
|
1957
|
-
if self.creator_name is not None:
|
|
1958
|
-
body["creator_name"] = self.creator_name
|
|
1959
|
-
if self.enable_photon is not None:
|
|
1960
|
-
body["enable_photon"] = self.enable_photon
|
|
1961
|
-
if self.enable_serverless_compute is not None:
|
|
1962
|
-
body["enable_serverless_compute"] = self.enable_serverless_compute
|
|
1963
|
-
if self.instance_profile_arn is not None:
|
|
1964
|
-
body["instance_profile_arn"] = self.instance_profile_arn
|
|
1965
|
-
if self.max_num_clusters is not None:
|
|
1966
|
-
body["max_num_clusters"] = self.max_num_clusters
|
|
1967
|
-
if self.min_num_clusters is not None:
|
|
1968
|
-
body["min_num_clusters"] = self.min_num_clusters
|
|
1969
|
-
if self.name is not None:
|
|
1970
|
-
body["name"] = self.name
|
|
1971
|
-
if self.spot_instance_policy is not None:
|
|
1972
|
-
body["spot_instance_policy"] = self.spot_instance_policy
|
|
1973
|
-
if self.tags:
|
|
1974
|
-
body["tags"] = self.tags
|
|
1975
|
-
if self.warehouse_type is not None:
|
|
1976
|
-
body["warehouse_type"] = self.warehouse_type
|
|
1977
|
-
return body
|
|
1978
|
-
|
|
1979
|
-
@classmethod
|
|
1980
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseRequest:
|
|
1981
|
-
"""Deserializes the CreateWarehouseRequest from a dictionary."""
|
|
1982
|
-
return cls(
|
|
1983
|
-
auto_stop_mins=d.get("auto_stop_mins", None),
|
|
1984
|
-
channel=_from_dict(d, "channel", Channel),
|
|
1985
|
-
cluster_size=d.get("cluster_size", None),
|
|
1986
|
-
creator_name=d.get("creator_name", None),
|
|
1987
|
-
enable_photon=d.get("enable_photon", None),
|
|
1988
|
-
enable_serverless_compute=d.get("enable_serverless_compute", None),
|
|
1989
|
-
instance_profile_arn=d.get("instance_profile_arn", None),
|
|
1990
|
-
max_num_clusters=d.get("max_num_clusters", None),
|
|
1991
|
-
min_num_clusters=d.get("min_num_clusters", None),
|
|
1992
|
-
name=d.get("name", None),
|
|
1993
|
-
spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy),
|
|
1994
|
-
tags=_from_dict(d, "tags", EndpointTags),
|
|
1995
|
-
warehouse_type=_enum(d, "warehouse_type", CreateWarehouseRequestWarehouseType),
|
|
1996
|
-
)
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
1632
|
class CreateWarehouseRequestWarehouseType(Enum):
|
|
2000
1633
|
"""Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, you must set to `PRO`
|
|
2001
1634
|
and also set the field `enable_serverless_compute` to `true`."""
|
|
@@ -2025,76 +1658,9 @@ class CreateWarehouseResponse:
|
|
|
2025
1658
|
return body
|
|
2026
1659
|
|
|
2027
1660
|
@classmethod
|
|
2028
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseResponse:
|
|
2029
|
-
"""Deserializes the CreateWarehouseResponse from a dictionary."""
|
|
2030
|
-
return cls(id=d.get("id", None))
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
@dataclass
|
|
2034
|
-
class CreateWidget:
|
|
2035
|
-
dashboard_id: str
|
|
2036
|
-
"""Dashboard ID returned by :method:dashboards/create."""
|
|
2037
|
-
|
|
2038
|
-
options: WidgetOptions
|
|
2039
|
-
|
|
2040
|
-
width: int
|
|
2041
|
-
"""Width of a widget"""
|
|
2042
|
-
|
|
2043
|
-
id: Optional[str] = None
|
|
2044
|
-
"""Widget ID returned by :method:dashboardwidgets/create"""
|
|
2045
|
-
|
|
2046
|
-
text: Optional[str] = None
|
|
2047
|
-
"""If this is a textbox widget, the application displays this text. This field is ignored if the
|
|
2048
|
-
widget contains a visualization in the `visualization` field."""
|
|
2049
|
-
|
|
2050
|
-
visualization_id: Optional[str] = None
|
|
2051
|
-
"""Query Vizualization ID returned by :method:queryvisualizations/create."""
|
|
2052
|
-
|
|
2053
|
-
def as_dict(self) -> dict:
|
|
2054
|
-
"""Serializes the CreateWidget into a dictionary suitable for use as a JSON request body."""
|
|
2055
|
-
body = {}
|
|
2056
|
-
if self.dashboard_id is not None:
|
|
2057
|
-
body["dashboard_id"] = self.dashboard_id
|
|
2058
|
-
if self.id is not None:
|
|
2059
|
-
body["id"] = self.id
|
|
2060
|
-
if self.options:
|
|
2061
|
-
body["options"] = self.options.as_dict()
|
|
2062
|
-
if self.text is not None:
|
|
2063
|
-
body["text"] = self.text
|
|
2064
|
-
if self.visualization_id is not None:
|
|
2065
|
-
body["visualization_id"] = self.visualization_id
|
|
2066
|
-
if self.width is not None:
|
|
2067
|
-
body["width"] = self.width
|
|
2068
|
-
return body
|
|
2069
|
-
|
|
2070
|
-
def as_shallow_dict(self) -> dict:
|
|
2071
|
-
"""Serializes the CreateWidget into a shallow dictionary of its immediate attributes."""
|
|
2072
|
-
body = {}
|
|
2073
|
-
if self.dashboard_id is not None:
|
|
2074
|
-
body["dashboard_id"] = self.dashboard_id
|
|
2075
|
-
if self.id is not None:
|
|
2076
|
-
body["id"] = self.id
|
|
2077
|
-
if self.options:
|
|
2078
|
-
body["options"] = self.options
|
|
2079
|
-
if self.text is not None:
|
|
2080
|
-
body["text"] = self.text
|
|
2081
|
-
if self.visualization_id is not None:
|
|
2082
|
-
body["visualization_id"] = self.visualization_id
|
|
2083
|
-
if self.width is not None:
|
|
2084
|
-
body["width"] = self.width
|
|
2085
|
-
return body
|
|
2086
|
-
|
|
2087
|
-
@classmethod
|
|
2088
|
-
def from_dict(cls, d: Dict[str, Any]) -> CreateWidget:
|
|
2089
|
-
"""Deserializes the CreateWidget from a dictionary."""
|
|
2090
|
-
return cls(
|
|
2091
|
-
dashboard_id=d.get("dashboard_id", None),
|
|
2092
|
-
id=d.get("id", None),
|
|
2093
|
-
options=_from_dict(d, "options", WidgetOptions),
|
|
2094
|
-
text=d.get("text", None),
|
|
2095
|
-
visualization_id=d.get("visualization_id", None),
|
|
2096
|
-
width=d.get("width", None),
|
|
2097
|
-
)
|
|
1661
|
+
def from_dict(cls, d: Dict[str, Any]) -> CreateWarehouseResponse:
|
|
1662
|
+
"""Deserializes the CreateWarehouseResponse from a dictionary."""
|
|
1663
|
+
return cls(id=d.get("id", None))
|
|
2098
1664
|
|
|
2099
1665
|
|
|
2100
1666
|
@dataclass
|
|
@@ -2304,56 +1870,6 @@ class Dashboard:
|
|
|
2304
1870
|
)
|
|
2305
1871
|
|
|
2306
1872
|
|
|
2307
|
-
@dataclass
|
|
2308
|
-
class DashboardEditContent:
|
|
2309
|
-
dashboard_id: Optional[str] = None
|
|
2310
|
-
|
|
2311
|
-
name: Optional[str] = None
|
|
2312
|
-
"""The title of this dashboard that appears in list views and at the top of the dashboard page."""
|
|
2313
|
-
|
|
2314
|
-
run_as_role: Optional[RunAsRole] = None
|
|
2315
|
-
"""Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
|
|
2316
|
-
viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
|
|
2317
|
-
|
|
2318
|
-
tags: Optional[List[str]] = None
|
|
2319
|
-
|
|
2320
|
-
def as_dict(self) -> dict:
|
|
2321
|
-
"""Serializes the DashboardEditContent into a dictionary suitable for use as a JSON request body."""
|
|
2322
|
-
body = {}
|
|
2323
|
-
if self.dashboard_id is not None:
|
|
2324
|
-
body["dashboard_id"] = self.dashboard_id
|
|
2325
|
-
if self.name is not None:
|
|
2326
|
-
body["name"] = self.name
|
|
2327
|
-
if self.run_as_role is not None:
|
|
2328
|
-
body["run_as_role"] = self.run_as_role.value
|
|
2329
|
-
if self.tags:
|
|
2330
|
-
body["tags"] = [v for v in self.tags]
|
|
2331
|
-
return body
|
|
2332
|
-
|
|
2333
|
-
def as_shallow_dict(self) -> dict:
|
|
2334
|
-
"""Serializes the DashboardEditContent into a shallow dictionary of its immediate attributes."""
|
|
2335
|
-
body = {}
|
|
2336
|
-
if self.dashboard_id is not None:
|
|
2337
|
-
body["dashboard_id"] = self.dashboard_id
|
|
2338
|
-
if self.name is not None:
|
|
2339
|
-
body["name"] = self.name
|
|
2340
|
-
if self.run_as_role is not None:
|
|
2341
|
-
body["run_as_role"] = self.run_as_role
|
|
2342
|
-
if self.tags:
|
|
2343
|
-
body["tags"] = self.tags
|
|
2344
|
-
return body
|
|
2345
|
-
|
|
2346
|
-
@classmethod
|
|
2347
|
-
def from_dict(cls, d: Dict[str, Any]) -> DashboardEditContent:
|
|
2348
|
-
"""Deserializes the DashboardEditContent from a dictionary."""
|
|
2349
|
-
return cls(
|
|
2350
|
-
dashboard_id=d.get("dashboard_id", None),
|
|
2351
|
-
name=d.get("name", None),
|
|
2352
|
-
run_as_role=_enum(d, "run_as_role", RunAsRole),
|
|
2353
|
-
tags=d.get("tags", None),
|
|
2354
|
-
)
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
1873
|
@dataclass
|
|
2358
1874
|
class DashboardOptions:
|
|
2359
1875
|
moved_to_trash_at: Optional[str] = None
|
|
@@ -2380,73 +1896,6 @@ class DashboardOptions:
|
|
|
2380
1896
|
return cls(moved_to_trash_at=d.get("moved_to_trash_at", None))
|
|
2381
1897
|
|
|
2382
1898
|
|
|
2383
|
-
@dataclass
|
|
2384
|
-
class DashboardPostContent:
|
|
2385
|
-
name: str
|
|
2386
|
-
"""The title of this dashboard that appears in list views and at the top of the dashboard page."""
|
|
2387
|
-
|
|
2388
|
-
dashboard_filters_enabled: Optional[bool] = None
|
|
2389
|
-
"""Indicates whether the dashboard filters are enabled"""
|
|
2390
|
-
|
|
2391
|
-
is_favorite: Optional[bool] = None
|
|
2392
|
-
"""Indicates whether this dashboard object should appear in the current user's favorites list."""
|
|
2393
|
-
|
|
2394
|
-
parent: Optional[str] = None
|
|
2395
|
-
"""The identifier of the workspace folder containing the object."""
|
|
2396
|
-
|
|
2397
|
-
run_as_role: Optional[RunAsRole] = None
|
|
2398
|
-
"""Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
|
|
2399
|
-
viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
|
|
2400
|
-
|
|
2401
|
-
tags: Optional[List[str]] = None
|
|
2402
|
-
|
|
2403
|
-
def as_dict(self) -> dict:
|
|
2404
|
-
"""Serializes the DashboardPostContent into a dictionary suitable for use as a JSON request body."""
|
|
2405
|
-
body = {}
|
|
2406
|
-
if self.dashboard_filters_enabled is not None:
|
|
2407
|
-
body["dashboard_filters_enabled"] = self.dashboard_filters_enabled
|
|
2408
|
-
if self.is_favorite is not None:
|
|
2409
|
-
body["is_favorite"] = self.is_favorite
|
|
2410
|
-
if self.name is not None:
|
|
2411
|
-
body["name"] = self.name
|
|
2412
|
-
if self.parent is not None:
|
|
2413
|
-
body["parent"] = self.parent
|
|
2414
|
-
if self.run_as_role is not None:
|
|
2415
|
-
body["run_as_role"] = self.run_as_role.value
|
|
2416
|
-
if self.tags:
|
|
2417
|
-
body["tags"] = [v for v in self.tags]
|
|
2418
|
-
return body
|
|
2419
|
-
|
|
2420
|
-
def as_shallow_dict(self) -> dict:
|
|
2421
|
-
"""Serializes the DashboardPostContent into a shallow dictionary of its immediate attributes."""
|
|
2422
|
-
body = {}
|
|
2423
|
-
if self.dashboard_filters_enabled is not None:
|
|
2424
|
-
body["dashboard_filters_enabled"] = self.dashboard_filters_enabled
|
|
2425
|
-
if self.is_favorite is not None:
|
|
2426
|
-
body["is_favorite"] = self.is_favorite
|
|
2427
|
-
if self.name is not None:
|
|
2428
|
-
body["name"] = self.name
|
|
2429
|
-
if self.parent is not None:
|
|
2430
|
-
body["parent"] = self.parent
|
|
2431
|
-
if self.run_as_role is not None:
|
|
2432
|
-
body["run_as_role"] = self.run_as_role
|
|
2433
|
-
if self.tags:
|
|
2434
|
-
body["tags"] = self.tags
|
|
2435
|
-
return body
|
|
2436
|
-
|
|
2437
|
-
@classmethod
|
|
2438
|
-
def from_dict(cls, d: Dict[str, Any]) -> DashboardPostContent:
|
|
2439
|
-
"""Deserializes the DashboardPostContent from a dictionary."""
|
|
2440
|
-
return cls(
|
|
2441
|
-
dashboard_filters_enabled=d.get("dashboard_filters_enabled", None),
|
|
2442
|
-
is_favorite=d.get("is_favorite", None),
|
|
2443
|
-
name=d.get("name", None),
|
|
2444
|
-
parent=d.get("parent", None),
|
|
2445
|
-
run_as_role=_enum(d, "run_as_role", RunAsRole),
|
|
2446
|
-
tags=d.get("tags", None),
|
|
2447
|
-
)
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
1899
|
@dataclass
|
|
2451
1900
|
class DataSource:
|
|
2452
1901
|
"""A JSON object representing a DBSQL data source / SQL warehouse."""
|
|
@@ -2710,258 +2159,39 @@ class DeleteResponse:
|
|
|
2710
2159
|
body = {}
|
|
2711
2160
|
return body
|
|
2712
2161
|
|
|
2713
|
-
def as_shallow_dict(self) -> dict:
|
|
2714
|
-
"""Serializes the DeleteResponse into a shallow dictionary of its immediate attributes."""
|
|
2715
|
-
body = {}
|
|
2716
|
-
return body
|
|
2717
|
-
|
|
2718
|
-
@classmethod
|
|
2719
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteResponse:
|
|
2720
|
-
"""Deserializes the DeleteResponse from a dictionary."""
|
|
2721
|
-
return cls()
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
@dataclass
|
|
2725
|
-
class DeleteWarehouseResponse:
|
|
2726
|
-
def as_dict(self) -> dict:
|
|
2727
|
-
"""Serializes the DeleteWarehouseResponse into a dictionary suitable for use as a JSON request body."""
|
|
2728
|
-
body = {}
|
|
2729
|
-
return body
|
|
2730
|
-
|
|
2731
|
-
def as_shallow_dict(self) -> dict:
|
|
2732
|
-
"""Serializes the DeleteWarehouseResponse into a shallow dictionary of its immediate attributes."""
|
|
2733
|
-
body = {}
|
|
2734
|
-
return body
|
|
2735
|
-
|
|
2736
|
-
@classmethod
|
|
2737
|
-
def from_dict(cls, d: Dict[str, Any]) -> DeleteWarehouseResponse:
|
|
2738
|
-
"""Deserializes the DeleteWarehouseResponse from a dictionary."""
|
|
2739
|
-
return cls()
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
class Disposition(Enum):
|
|
2743
|
-
|
|
2744
|
-
EXTERNAL_LINKS = "EXTERNAL_LINKS"
|
|
2745
|
-
INLINE = "INLINE"
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
@dataclass
|
|
2749
|
-
class EditAlert:
|
|
2750
|
-
name: str
|
|
2751
|
-
"""Name of the alert."""
|
|
2752
|
-
|
|
2753
|
-
options: AlertOptions
|
|
2754
|
-
"""Alert configuration options."""
|
|
2755
|
-
|
|
2756
|
-
query_id: str
|
|
2757
|
-
"""Query ID."""
|
|
2758
|
-
|
|
2759
|
-
alert_id: Optional[str] = None
|
|
2760
|
-
|
|
2761
|
-
rearm: Optional[int] = None
|
|
2762
|
-
"""Number of seconds after being triggered before the alert rearms itself and can be triggered
|
|
2763
|
-
again. If `null`, alert will never be triggered again."""
|
|
2764
|
-
|
|
2765
|
-
def as_dict(self) -> dict:
|
|
2766
|
-
"""Serializes the EditAlert into a dictionary suitable for use as a JSON request body."""
|
|
2767
|
-
body = {}
|
|
2768
|
-
if self.alert_id is not None:
|
|
2769
|
-
body["alert_id"] = self.alert_id
|
|
2770
|
-
if self.name is not None:
|
|
2771
|
-
body["name"] = self.name
|
|
2772
|
-
if self.options:
|
|
2773
|
-
body["options"] = self.options.as_dict()
|
|
2774
|
-
if self.query_id is not None:
|
|
2775
|
-
body["query_id"] = self.query_id
|
|
2776
|
-
if self.rearm is not None:
|
|
2777
|
-
body["rearm"] = self.rearm
|
|
2778
|
-
return body
|
|
2779
|
-
|
|
2780
|
-
def as_shallow_dict(self) -> dict:
|
|
2781
|
-
"""Serializes the EditAlert into a shallow dictionary of its immediate attributes."""
|
|
2782
|
-
body = {}
|
|
2783
|
-
if self.alert_id is not None:
|
|
2784
|
-
body["alert_id"] = self.alert_id
|
|
2785
|
-
if self.name is not None:
|
|
2786
|
-
body["name"] = self.name
|
|
2787
|
-
if self.options:
|
|
2788
|
-
body["options"] = self.options
|
|
2789
|
-
if self.query_id is not None:
|
|
2790
|
-
body["query_id"] = self.query_id
|
|
2791
|
-
if self.rearm is not None:
|
|
2792
|
-
body["rearm"] = self.rearm
|
|
2793
|
-
return body
|
|
2794
|
-
|
|
2795
|
-
@classmethod
|
|
2796
|
-
def from_dict(cls, d: Dict[str, Any]) -> EditAlert:
|
|
2797
|
-
"""Deserializes the EditAlert from a dictionary."""
|
|
2798
|
-
return cls(
|
|
2799
|
-
alert_id=d.get("alert_id", None),
|
|
2800
|
-
name=d.get("name", None),
|
|
2801
|
-
options=_from_dict(d, "options", AlertOptions),
|
|
2802
|
-
query_id=d.get("query_id", None),
|
|
2803
|
-
rearm=d.get("rearm", None),
|
|
2804
|
-
)
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
@dataclass
|
|
2808
|
-
class EditWarehouseRequest:
|
|
2809
|
-
auto_stop_mins: Optional[int] = None
|
|
2810
|
-
"""The amount of time in minutes that a SQL warehouse must be idle (i.e., no RUNNING queries)
|
|
2811
|
-
before it is automatically stopped.
|
|
2812
|
-
|
|
2813
|
-
Supported values: - Must be == 0 or >= 10 mins - 0 indicates no autostop.
|
|
2814
|
-
|
|
2815
|
-
Defaults to 120 mins"""
|
|
2816
|
-
|
|
2817
|
-
channel: Optional[Channel] = None
|
|
2818
|
-
"""Channel Details"""
|
|
2819
|
-
|
|
2820
|
-
cluster_size: Optional[str] = None
|
|
2821
|
-
"""Size of the clusters allocated for this warehouse. Increasing the size of a spark cluster allows
|
|
2822
|
-
you to run larger queries on it. If you want to increase the number of concurrent queries,
|
|
2823
|
-
please tune max_num_clusters.
|
|
2824
|
-
|
|
2825
|
-
Supported values: - 2X-Small - X-Small - Small - Medium - Large - X-Large - 2X-Large - 3X-Large
|
|
2826
|
-
- 4X-Large"""
|
|
2827
|
-
|
|
2828
|
-
creator_name: Optional[str] = None
|
|
2829
|
-
"""warehouse creator name"""
|
|
2830
|
-
|
|
2831
|
-
enable_photon: Optional[bool] = None
|
|
2832
|
-
"""Configures whether the warehouse should use Photon optimized clusters.
|
|
2833
|
-
|
|
2834
|
-
Defaults to false."""
|
|
2835
|
-
|
|
2836
|
-
enable_serverless_compute: Optional[bool] = None
|
|
2837
|
-
"""Configures whether the warehouse should use serverless compute."""
|
|
2838
|
-
|
|
2839
|
-
id: Optional[str] = None
|
|
2840
|
-
"""Required. Id of the warehouse to configure."""
|
|
2841
|
-
|
|
2842
|
-
instance_profile_arn: Optional[str] = None
|
|
2843
|
-
"""Deprecated. Instance profile used to pass IAM role to the cluster"""
|
|
2844
|
-
|
|
2845
|
-
max_num_clusters: Optional[int] = None
|
|
2846
|
-
"""Maximum number of clusters that the autoscaler will create to handle concurrent queries.
|
|
2847
|
-
|
|
2848
|
-
Supported values: - Must be >= min_num_clusters - Must be <= 30.
|
|
2849
|
-
|
|
2850
|
-
Defaults to min_clusters if unset."""
|
|
2851
|
-
|
|
2852
|
-
min_num_clusters: Optional[int] = None
|
|
2853
|
-
"""Minimum number of available clusters that will be maintained for this SQL warehouse. Increasing
|
|
2854
|
-
this will ensure that a larger number of clusters are always running and therefore may reduce
|
|
2855
|
-
the cold start time for new queries. This is similar to reserved vs. revocable cores in a
|
|
2856
|
-
resource manager.
|
|
2857
|
-
|
|
2858
|
-
Supported values: - Must be > 0 - Must be <= min(max_num_clusters, 30)
|
|
2859
|
-
|
|
2860
|
-
Defaults to 1"""
|
|
2861
|
-
|
|
2862
|
-
name: Optional[str] = None
|
|
2863
|
-
"""Logical name for the cluster.
|
|
2864
|
-
|
|
2865
|
-
Supported values: - Must be unique within an org. - Must be less than 100 characters."""
|
|
2866
|
-
|
|
2867
|
-
spot_instance_policy: Optional[SpotInstancePolicy] = None
|
|
2868
|
-
"""Configurations whether the warehouse should use spot instances."""
|
|
2162
|
+
def as_shallow_dict(self) -> dict:
|
|
2163
|
+
"""Serializes the DeleteResponse into a shallow dictionary of its immediate attributes."""
|
|
2164
|
+
body = {}
|
|
2165
|
+
return body
|
|
2869
2166
|
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
Supported values: - Number of tags < 45."""
|
|
2167
|
+
@classmethod
|
|
2168
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeleteResponse:
|
|
2169
|
+
"""Deserializes the DeleteResponse from a dictionary."""
|
|
2170
|
+
return cls()
|
|
2875
2171
|
|
|
2876
|
-
warehouse_type: Optional[EditWarehouseRequestWarehouseType] = None
|
|
2877
|
-
"""Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, you must set to `PRO`
|
|
2878
|
-
and also set the field `enable_serverless_compute` to `true`."""
|
|
2879
2172
|
|
|
2173
|
+
@dataclass
|
|
2174
|
+
class DeleteWarehouseResponse:
|
|
2880
2175
|
def as_dict(self) -> dict:
|
|
2881
|
-
"""Serializes the
|
|
2176
|
+
"""Serializes the DeleteWarehouseResponse into a dictionary suitable for use as a JSON request body."""
|
|
2882
2177
|
body = {}
|
|
2883
|
-
if self.auto_stop_mins is not None:
|
|
2884
|
-
body["auto_stop_mins"] = self.auto_stop_mins
|
|
2885
|
-
if self.channel:
|
|
2886
|
-
body["channel"] = self.channel.as_dict()
|
|
2887
|
-
if self.cluster_size is not None:
|
|
2888
|
-
body["cluster_size"] = self.cluster_size
|
|
2889
|
-
if self.creator_name is not None:
|
|
2890
|
-
body["creator_name"] = self.creator_name
|
|
2891
|
-
if self.enable_photon is not None:
|
|
2892
|
-
body["enable_photon"] = self.enable_photon
|
|
2893
|
-
if self.enable_serverless_compute is not None:
|
|
2894
|
-
body["enable_serverless_compute"] = self.enable_serverless_compute
|
|
2895
|
-
if self.id is not None:
|
|
2896
|
-
body["id"] = self.id
|
|
2897
|
-
if self.instance_profile_arn is not None:
|
|
2898
|
-
body["instance_profile_arn"] = self.instance_profile_arn
|
|
2899
|
-
if self.max_num_clusters is not None:
|
|
2900
|
-
body["max_num_clusters"] = self.max_num_clusters
|
|
2901
|
-
if self.min_num_clusters is not None:
|
|
2902
|
-
body["min_num_clusters"] = self.min_num_clusters
|
|
2903
|
-
if self.name is not None:
|
|
2904
|
-
body["name"] = self.name
|
|
2905
|
-
if self.spot_instance_policy is not None:
|
|
2906
|
-
body["spot_instance_policy"] = self.spot_instance_policy.value
|
|
2907
|
-
if self.tags:
|
|
2908
|
-
body["tags"] = self.tags.as_dict()
|
|
2909
|
-
if self.warehouse_type is not None:
|
|
2910
|
-
body["warehouse_type"] = self.warehouse_type.value
|
|
2911
2178
|
return body
|
|
2912
2179
|
|
|
2913
2180
|
def as_shallow_dict(self) -> dict:
|
|
2914
|
-
"""Serializes the
|
|
2181
|
+
"""Serializes the DeleteWarehouseResponse into a shallow dictionary of its immediate attributes."""
|
|
2915
2182
|
body = {}
|
|
2916
|
-
if self.auto_stop_mins is not None:
|
|
2917
|
-
body["auto_stop_mins"] = self.auto_stop_mins
|
|
2918
|
-
if self.channel:
|
|
2919
|
-
body["channel"] = self.channel
|
|
2920
|
-
if self.cluster_size is not None:
|
|
2921
|
-
body["cluster_size"] = self.cluster_size
|
|
2922
|
-
if self.creator_name is not None:
|
|
2923
|
-
body["creator_name"] = self.creator_name
|
|
2924
|
-
if self.enable_photon is not None:
|
|
2925
|
-
body["enable_photon"] = self.enable_photon
|
|
2926
|
-
if self.enable_serverless_compute is not None:
|
|
2927
|
-
body["enable_serverless_compute"] = self.enable_serverless_compute
|
|
2928
|
-
if self.id is not None:
|
|
2929
|
-
body["id"] = self.id
|
|
2930
|
-
if self.instance_profile_arn is not None:
|
|
2931
|
-
body["instance_profile_arn"] = self.instance_profile_arn
|
|
2932
|
-
if self.max_num_clusters is not None:
|
|
2933
|
-
body["max_num_clusters"] = self.max_num_clusters
|
|
2934
|
-
if self.min_num_clusters is not None:
|
|
2935
|
-
body["min_num_clusters"] = self.min_num_clusters
|
|
2936
|
-
if self.name is not None:
|
|
2937
|
-
body["name"] = self.name
|
|
2938
|
-
if self.spot_instance_policy is not None:
|
|
2939
|
-
body["spot_instance_policy"] = self.spot_instance_policy
|
|
2940
|
-
if self.tags:
|
|
2941
|
-
body["tags"] = self.tags
|
|
2942
|
-
if self.warehouse_type is not None:
|
|
2943
|
-
body["warehouse_type"] = self.warehouse_type
|
|
2944
2183
|
return body
|
|
2945
2184
|
|
|
2946
2185
|
@classmethod
|
|
2947
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
2948
|
-
"""Deserializes the
|
|
2949
|
-
return cls(
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
id=d.get("id", None),
|
|
2957
|
-
instance_profile_arn=d.get("instance_profile_arn", None),
|
|
2958
|
-
max_num_clusters=d.get("max_num_clusters", None),
|
|
2959
|
-
min_num_clusters=d.get("min_num_clusters", None),
|
|
2960
|
-
name=d.get("name", None),
|
|
2961
|
-
spot_instance_policy=_enum(d, "spot_instance_policy", SpotInstancePolicy),
|
|
2962
|
-
tags=_from_dict(d, "tags", EndpointTags),
|
|
2963
|
-
warehouse_type=_enum(d, "warehouse_type", EditWarehouseRequestWarehouseType),
|
|
2964
|
-
)
|
|
2186
|
+
def from_dict(cls, d: Dict[str, Any]) -> DeleteWarehouseResponse:
|
|
2187
|
+
"""Deserializes the DeleteWarehouseResponse from a dictionary."""
|
|
2188
|
+
return cls()
|
|
2189
|
+
|
|
2190
|
+
|
|
2191
|
+
class Disposition(Enum):
|
|
2192
|
+
|
|
2193
|
+
EXTERNAL_LINKS = "EXTERNAL_LINKS"
|
|
2194
|
+
INLINE = "INLINE"
|
|
2965
2195
|
|
|
2966
2196
|
|
|
2967
2197
|
class EditWarehouseRequestWarehouseType(Enum):
|
|
@@ -3055,7 +2285,6 @@ class EndpointHealth:
|
|
|
3055
2285
|
"""Deprecated. split into summary and details for security"""
|
|
3056
2286
|
|
|
3057
2287
|
status: Optional[Status] = None
|
|
3058
|
-
"""Health status of the warehouse."""
|
|
3059
2288
|
|
|
3060
2289
|
summary: Optional[str] = None
|
|
3061
2290
|
"""A short summary of the health status in case of degraded/failed warehouses."""
|
|
@@ -3178,10 +2407,8 @@ class EndpointInfo:
|
|
|
3178
2407
|
"""ODBC parameters for the SQL warehouse"""
|
|
3179
2408
|
|
|
3180
2409
|
spot_instance_policy: Optional[SpotInstancePolicy] = None
|
|
3181
|
-
"""Configurations whether the warehouse should use spot instances."""
|
|
3182
2410
|
|
|
3183
2411
|
state: Optional[State] = None
|
|
3184
|
-
"""State of the warehouse"""
|
|
3185
2412
|
|
|
3186
2413
|
tags: Optional[EndpointTags] = None
|
|
3187
2414
|
"""A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS
|
|
@@ -3416,195 +2643,6 @@ class EnumValue:
|
|
|
3416
2643
|
)
|
|
3417
2644
|
|
|
3418
2645
|
|
|
3419
|
-
@dataclass
|
|
3420
|
-
class ExecuteStatementRequest:
|
|
3421
|
-
statement: str
|
|
3422
|
-
"""The SQL statement to execute. The statement can optionally be parameterized, see `parameters`."""
|
|
3423
|
-
|
|
3424
|
-
warehouse_id: str
|
|
3425
|
-
"""Warehouse upon which to execute a statement. See also [What are SQL warehouses?]
|
|
3426
|
-
|
|
3427
|
-
[What are SQL warehouses?]: https://docs.databricks.com/sql/admin/warehouse-type.html"""
|
|
3428
|
-
|
|
3429
|
-
byte_limit: Optional[int] = None
|
|
3430
|
-
"""Applies the given byte limit to the statement's result size. Byte counts are based on internal
|
|
3431
|
-
data representations and might not match the final size in the requested `format`. If the result
|
|
3432
|
-
was truncated due to the byte limit, then `truncated` in the response is set to `true`. When
|
|
3433
|
-
using `EXTERNAL_LINKS` disposition, a default `byte_limit` of 100 GiB is applied if `byte_limit`
|
|
3434
|
-
is not explcitly set."""
|
|
3435
|
-
|
|
3436
|
-
catalog: Optional[str] = None
|
|
3437
|
-
"""Sets default catalog for statement execution, similar to [`USE CATALOG`] in SQL.
|
|
3438
|
-
|
|
3439
|
-
[`USE CATALOG`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-catalog.html"""
|
|
3440
|
-
|
|
3441
|
-
disposition: Optional[Disposition] = None
|
|
3442
|
-
|
|
3443
|
-
format: Optional[Format] = None
|
|
3444
|
-
"""Statement execution supports three result formats: `JSON_ARRAY` (default), `ARROW_STREAM`, and
|
|
3445
|
-
`CSV`.
|
|
3446
|
-
|
|
3447
|
-
Important: The formats `ARROW_STREAM` and `CSV` are supported only with `EXTERNAL_LINKS`
|
|
3448
|
-
disposition. `JSON_ARRAY` is supported in `INLINE` and `EXTERNAL_LINKS` disposition.
|
|
3449
|
-
|
|
3450
|
-
When specifying `format=JSON_ARRAY`, result data will be formatted as an array of arrays of
|
|
3451
|
-
values, where each value is either the *string representation* of a value, or `null`. For
|
|
3452
|
-
example, the output of `SELECT concat('id-', id) AS strCol, id AS intCol, null AS nullCol FROM
|
|
3453
|
-
range(3)` would look like this:
|
|
3454
|
-
|
|
3455
|
-
``` [ [ "id-1", "1", null ], [ "id-2", "2", null ], [ "id-3", "3", null ], ] ```
|
|
3456
|
-
|
|
3457
|
-
When specifying `format=JSON_ARRAY` and `disposition=EXTERNAL_LINKS`, each chunk in the result
|
|
3458
|
-
contains compact JSON with no indentation or extra whitespace.
|
|
3459
|
-
|
|
3460
|
-
When specifying `format=ARROW_STREAM` and `disposition=EXTERNAL_LINKS`, each chunk in the result
|
|
3461
|
-
will be formatted as Apache Arrow Stream. See the [Apache Arrow streaming format].
|
|
3462
|
-
|
|
3463
|
-
When specifying `format=CSV` and `disposition=EXTERNAL_LINKS`, each chunk in the result will be
|
|
3464
|
-
a CSV according to [RFC 4180] standard. All the columns values will have *string representation*
|
|
3465
|
-
similar to the `JSON_ARRAY` format, and `null` values will be encoded as “null”. Only the
|
|
3466
|
-
first chunk in the result would contain a header row with column names. For example, the output
|
|
3467
|
-
of `SELECT concat('id-', id) AS strCol, id AS intCol, null as nullCol FROM range(3)` would look
|
|
3468
|
-
like this:
|
|
3469
|
-
|
|
3470
|
-
``` strCol,intCol,nullCol id-1,1,null id-2,2,null id-3,3,null ```
|
|
3471
|
-
|
|
3472
|
-
[Apache Arrow streaming format]: https://arrow.apache.org/docs/format/Columnar.html#ipc-streaming-format
|
|
3473
|
-
[RFC 4180]: https://www.rfc-editor.org/rfc/rfc4180"""
|
|
3474
|
-
|
|
3475
|
-
on_wait_timeout: Optional[ExecuteStatementRequestOnWaitTimeout] = None
|
|
3476
|
-
"""When `wait_timeout > 0s`, the call will block up to the specified time. If the statement
|
|
3477
|
-
execution doesn't finish within this time, `on_wait_timeout` determines whether the execution
|
|
3478
|
-
should continue or be canceled. When set to `CONTINUE`, the statement execution continues
|
|
3479
|
-
asynchronously and the call returns a statement ID which can be used for polling with
|
|
3480
|
-
:method:statementexecution/getStatement. When set to `CANCEL`, the statement execution is
|
|
3481
|
-
canceled and the call returns with a `CANCELED` state."""
|
|
3482
|
-
|
|
3483
|
-
parameters: Optional[List[StatementParameterListItem]] = None
|
|
3484
|
-
"""A list of parameters to pass into a SQL statement containing parameter markers. A parameter
|
|
3485
|
-
consists of a name, a value, and optionally a type. To represent a NULL value, the `value` field
|
|
3486
|
-
may be omitted or set to `null` explicitly. If the `type` field is omitted, the value is
|
|
3487
|
-
interpreted as a string.
|
|
3488
|
-
|
|
3489
|
-
If the type is given, parameters will be checked for type correctness according to the given
|
|
3490
|
-
type. A value is correct if the provided string can be converted to the requested type using the
|
|
3491
|
-
`cast` function. The exact semantics are described in the section [`cast` function] of the SQL
|
|
3492
|
-
language reference.
|
|
3493
|
-
|
|
3494
|
-
For example, the following statement contains two parameters, `my_name` and `my_date`:
|
|
3495
|
-
|
|
3496
|
-
SELECT * FROM my_table WHERE name = :my_name AND date = :my_date
|
|
3497
|
-
|
|
3498
|
-
The parameters can be passed in the request body as follows:
|
|
3499
|
-
|
|
3500
|
-
{ ..., "statement": "SELECT * FROM my_table WHERE name = :my_name AND date = :my_date",
|
|
3501
|
-
"parameters": [ { "name": "my_name", "value": "the name" }, { "name": "my_date", "value":
|
|
3502
|
-
"2020-01-01", "type": "DATE" } ] }
|
|
3503
|
-
|
|
3504
|
-
Currently, positional parameters denoted by a `?` marker are not supported by the Databricks SQL
|
|
3505
|
-
Statement Execution API.
|
|
3506
|
-
|
|
3507
|
-
Also see the section [Parameter markers] of the SQL language reference.
|
|
3508
|
-
|
|
3509
|
-
[Parameter markers]: https://docs.databricks.com/sql/language-manual/sql-ref-parameter-marker.html
|
|
3510
|
-
[`cast` function]: https://docs.databricks.com/sql/language-manual/functions/cast.html"""
|
|
3511
|
-
|
|
3512
|
-
row_limit: Optional[int] = None
|
|
3513
|
-
"""Applies the given row limit to the statement's result set, but unlike the `LIMIT` clause in SQL,
|
|
3514
|
-
it also sets the `truncated` field in the response to indicate whether the result was trimmed
|
|
3515
|
-
due to the limit or not."""
|
|
3516
|
-
|
|
3517
|
-
schema: Optional[str] = None
|
|
3518
|
-
"""Sets default schema for statement execution, similar to [`USE SCHEMA`] in SQL.
|
|
3519
|
-
|
|
3520
|
-
[`USE SCHEMA`]: https://docs.databricks.com/sql/language-manual/sql-ref-syntax-ddl-use-schema.html"""
|
|
3521
|
-
|
|
3522
|
-
wait_timeout: Optional[str] = None
|
|
3523
|
-
"""The time in seconds the call will wait for the statement's result set as `Ns`, where `N` can be
|
|
3524
|
-
set to 0 or to a value between 5 and 50.
|
|
3525
|
-
|
|
3526
|
-
When set to `0s`, the statement will execute in asynchronous mode and the call will not wait for
|
|
3527
|
-
the execution to finish. In this case, the call returns directly with `PENDING` state and a
|
|
3528
|
-
statement ID which can be used for polling with :method:statementexecution/getStatement.
|
|
3529
|
-
|
|
3530
|
-
When set between 5 and 50 seconds, the call will behave synchronously up to this timeout and
|
|
3531
|
-
wait for the statement execution to finish. If the execution finishes within this time, the call
|
|
3532
|
-
returns immediately with a manifest and result data (or a `FAILED` state in case of an execution
|
|
3533
|
-
error). If the statement takes longer to execute, `on_wait_timeout` determines what should
|
|
3534
|
-
happen after the timeout is reached."""
|
|
3535
|
-
|
|
3536
|
-
def as_dict(self) -> dict:
|
|
3537
|
-
"""Serializes the ExecuteStatementRequest into a dictionary suitable for use as a JSON request body."""
|
|
3538
|
-
body = {}
|
|
3539
|
-
if self.byte_limit is not None:
|
|
3540
|
-
body["byte_limit"] = self.byte_limit
|
|
3541
|
-
if self.catalog is not None:
|
|
3542
|
-
body["catalog"] = self.catalog
|
|
3543
|
-
if self.disposition is not None:
|
|
3544
|
-
body["disposition"] = self.disposition.value
|
|
3545
|
-
if self.format is not None:
|
|
3546
|
-
body["format"] = self.format.value
|
|
3547
|
-
if self.on_wait_timeout is not None:
|
|
3548
|
-
body["on_wait_timeout"] = self.on_wait_timeout.value
|
|
3549
|
-
if self.parameters:
|
|
3550
|
-
body["parameters"] = [v.as_dict() for v in self.parameters]
|
|
3551
|
-
if self.row_limit is not None:
|
|
3552
|
-
body["row_limit"] = self.row_limit
|
|
3553
|
-
if self.schema is not None:
|
|
3554
|
-
body["schema"] = self.schema
|
|
3555
|
-
if self.statement is not None:
|
|
3556
|
-
body["statement"] = self.statement
|
|
3557
|
-
if self.wait_timeout is not None:
|
|
3558
|
-
body["wait_timeout"] = self.wait_timeout
|
|
3559
|
-
if self.warehouse_id is not None:
|
|
3560
|
-
body["warehouse_id"] = self.warehouse_id
|
|
3561
|
-
return body
|
|
3562
|
-
|
|
3563
|
-
def as_shallow_dict(self) -> dict:
|
|
3564
|
-
"""Serializes the ExecuteStatementRequest into a shallow dictionary of its immediate attributes."""
|
|
3565
|
-
body = {}
|
|
3566
|
-
if self.byte_limit is not None:
|
|
3567
|
-
body["byte_limit"] = self.byte_limit
|
|
3568
|
-
if self.catalog is not None:
|
|
3569
|
-
body["catalog"] = self.catalog
|
|
3570
|
-
if self.disposition is not None:
|
|
3571
|
-
body["disposition"] = self.disposition
|
|
3572
|
-
if self.format is not None:
|
|
3573
|
-
body["format"] = self.format
|
|
3574
|
-
if self.on_wait_timeout is not None:
|
|
3575
|
-
body["on_wait_timeout"] = self.on_wait_timeout
|
|
3576
|
-
if self.parameters:
|
|
3577
|
-
body["parameters"] = self.parameters
|
|
3578
|
-
if self.row_limit is not None:
|
|
3579
|
-
body["row_limit"] = self.row_limit
|
|
3580
|
-
if self.schema is not None:
|
|
3581
|
-
body["schema"] = self.schema
|
|
3582
|
-
if self.statement is not None:
|
|
3583
|
-
body["statement"] = self.statement
|
|
3584
|
-
if self.wait_timeout is not None:
|
|
3585
|
-
body["wait_timeout"] = self.wait_timeout
|
|
3586
|
-
if self.warehouse_id is not None:
|
|
3587
|
-
body["warehouse_id"] = self.warehouse_id
|
|
3588
|
-
return body
|
|
3589
|
-
|
|
3590
|
-
@classmethod
|
|
3591
|
-
def from_dict(cls, d: Dict[str, Any]) -> ExecuteStatementRequest:
|
|
3592
|
-
"""Deserializes the ExecuteStatementRequest from a dictionary."""
|
|
3593
|
-
return cls(
|
|
3594
|
-
byte_limit=d.get("byte_limit", None),
|
|
3595
|
-
catalog=d.get("catalog", None),
|
|
3596
|
-
disposition=_enum(d, "disposition", Disposition),
|
|
3597
|
-
format=_enum(d, "format", Format),
|
|
3598
|
-
on_wait_timeout=_enum(d, "on_wait_timeout", ExecuteStatementRequestOnWaitTimeout),
|
|
3599
|
-
parameters=_repeated_dict(d, "parameters", StatementParameterListItem),
|
|
3600
|
-
row_limit=d.get("row_limit", None),
|
|
3601
|
-
schema=d.get("schema", None),
|
|
3602
|
-
statement=d.get("statement", None),
|
|
3603
|
-
wait_timeout=d.get("wait_timeout", None),
|
|
3604
|
-
warehouse_id=d.get("warehouse_id", None),
|
|
3605
|
-
)
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
2646
|
class ExecuteStatementRequestOnWaitTimeout(Enum):
|
|
3609
2647
|
"""When `wait_timeout > 0s`, the call will block up to the specified time. If the statement
|
|
3610
2648
|
execution doesn't finish within this time, `on_wait_timeout` determines whether the execution
|
|
@@ -3983,10 +3021,8 @@ class GetWarehouseResponse:
|
|
|
3983
3021
|
"""ODBC parameters for the SQL warehouse"""
|
|
3984
3022
|
|
|
3985
3023
|
spot_instance_policy: Optional[SpotInstancePolicy] = None
|
|
3986
|
-
"""Configurations whether the warehouse should use spot instances."""
|
|
3987
3024
|
|
|
3988
3025
|
state: Optional[State] = None
|
|
3989
|
-
"""State of the warehouse"""
|
|
3990
3026
|
|
|
3991
3027
|
tags: Optional[EndpointTags] = None
|
|
3992
3028
|
"""A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS
|
|
@@ -3995,8 +3031,6 @@ class GetWarehouseResponse:
|
|
|
3995
3031
|
Supported values: - Number of tags < 45."""
|
|
3996
3032
|
|
|
3997
3033
|
warehouse_type: Optional[GetWarehouseResponseWarehouseType] = None
|
|
3998
|
-
"""Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, you must set to `PRO`
|
|
3999
|
-
and also set the field `enable_serverless_compute` to `true`."""
|
|
4000
3034
|
|
|
4001
3035
|
def as_dict(self) -> dict:
|
|
4002
3036
|
"""Serializes the GetWarehouseResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -4336,8 +3370,6 @@ class LegacyAlert:
|
|
|
4336
3370
|
|
|
4337
3371
|
|
|
4338
3372
|
class LegacyAlertState(Enum):
|
|
4339
|
-
"""State of the alert. Possible values are: `unknown` (yet to be evaluated), `triggered` (evaluated
|
|
4340
|
-
and fulfilled trigger conditions), or `ok` (evaluated and did not fulfill trigger conditions)."""
|
|
4341
3373
|
|
|
4342
3374
|
OK = "ok"
|
|
4343
3375
|
TRIGGERED = "triggered"
|
|
@@ -5317,7 +4349,6 @@ class OdbcParams:
|
|
|
5317
4349
|
|
|
5318
4350
|
|
|
5319
4351
|
class OwnableObjectType(Enum):
|
|
5320
|
-
"""The singular form of the type of object which can be owned."""
|
|
5321
4352
|
|
|
5322
4353
|
ALERT = "alert"
|
|
5323
4354
|
DASHBOARD = "dashboard"
|
|
@@ -5402,7 +4433,6 @@ class Parameter:
|
|
|
5402
4433
|
|
|
5403
4434
|
|
|
5404
4435
|
class ParameterType(Enum):
|
|
5405
|
-
"""Parameters can have several different types."""
|
|
5406
4436
|
|
|
5407
4437
|
DATETIME = "datetime"
|
|
5408
4438
|
ENUM = "enum"
|
|
@@ -5575,144 +4605,57 @@ class Query:
|
|
|
5575
4605
|
last_modifier_user_name=d.get("last_modifier_user_name", None),
|
|
5576
4606
|
lifecycle_state=_enum(d, "lifecycle_state", LifecycleState),
|
|
5577
4607
|
owner_user_name=d.get("owner_user_name", None),
|
|
5578
|
-
parameters=_repeated_dict(d, "parameters", QueryParameter),
|
|
5579
|
-
parent_path=d.get("parent_path", None),
|
|
5580
|
-
query_text=d.get("query_text", None),
|
|
5581
|
-
run_as_mode=_enum(d, "run_as_mode", RunAsMode),
|
|
5582
|
-
schema=d.get("schema", None),
|
|
5583
|
-
tags=d.get("tags", None),
|
|
5584
|
-
update_time=d.get("update_time", None),
|
|
5585
|
-
warehouse_id=d.get("warehouse_id", None),
|
|
5586
|
-
)
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
@dataclass
|
|
5590
|
-
class QueryBackedValue:
|
|
5591
|
-
multi_values_options: Optional[MultiValuesOptions] = None
|
|
5592
|
-
"""If specified, allows multiple values to be selected for this parameter."""
|
|
5593
|
-
|
|
5594
|
-
query_id: Optional[str] = None
|
|
5595
|
-
"""UUID of the query that provides the parameter values."""
|
|
5596
|
-
|
|
5597
|
-
values: Optional[List[str]] = None
|
|
5598
|
-
"""List of selected query parameter values."""
|
|
5599
|
-
|
|
5600
|
-
def as_dict(self) -> dict:
|
|
5601
|
-
"""Serializes the QueryBackedValue into a dictionary suitable for use as a JSON request body."""
|
|
5602
|
-
body = {}
|
|
5603
|
-
if self.multi_values_options:
|
|
5604
|
-
body["multi_values_options"] = self.multi_values_options.as_dict()
|
|
5605
|
-
if self.query_id is not None:
|
|
5606
|
-
body["query_id"] = self.query_id
|
|
5607
|
-
if self.values:
|
|
5608
|
-
body["values"] = [v for v in self.values]
|
|
5609
|
-
return body
|
|
5610
|
-
|
|
5611
|
-
def as_shallow_dict(self) -> dict:
|
|
5612
|
-
"""Serializes the QueryBackedValue into a shallow dictionary of its immediate attributes."""
|
|
5613
|
-
body = {}
|
|
5614
|
-
if self.multi_values_options:
|
|
5615
|
-
body["multi_values_options"] = self.multi_values_options
|
|
5616
|
-
if self.query_id is not None:
|
|
5617
|
-
body["query_id"] = self.query_id
|
|
5618
|
-
if self.values:
|
|
5619
|
-
body["values"] = self.values
|
|
5620
|
-
return body
|
|
5621
|
-
|
|
5622
|
-
@classmethod
|
|
5623
|
-
def from_dict(cls, d: Dict[str, Any]) -> QueryBackedValue:
|
|
5624
|
-
"""Deserializes the QueryBackedValue from a dictionary."""
|
|
5625
|
-
return cls(
|
|
5626
|
-
multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions),
|
|
5627
|
-
query_id=d.get("query_id", None),
|
|
5628
|
-
values=d.get("values", None),
|
|
5629
|
-
)
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
@dataclass
|
|
5633
|
-
class QueryEditContent:
|
|
5634
|
-
data_source_id: Optional[str] = None
|
|
5635
|
-
"""Data source ID maps to the ID of the data source used by the resource and is distinct from the
|
|
5636
|
-
warehouse ID. [Learn more]
|
|
5637
|
-
|
|
5638
|
-
[Learn more]: https://docs.databricks.com/api/workspace/datasources/list"""
|
|
5639
|
-
|
|
5640
|
-
description: Optional[str] = None
|
|
5641
|
-
"""General description that conveys additional information about this query such as usage notes."""
|
|
5642
|
-
|
|
5643
|
-
name: Optional[str] = None
|
|
5644
|
-
"""The title of this query that appears in list views, widget headings, and on the query page."""
|
|
4608
|
+
parameters=_repeated_dict(d, "parameters", QueryParameter),
|
|
4609
|
+
parent_path=d.get("parent_path", None),
|
|
4610
|
+
query_text=d.get("query_text", None),
|
|
4611
|
+
run_as_mode=_enum(d, "run_as_mode", RunAsMode),
|
|
4612
|
+
schema=d.get("schema", None),
|
|
4613
|
+
tags=d.get("tags", None),
|
|
4614
|
+
update_time=d.get("update_time", None),
|
|
4615
|
+
warehouse_id=d.get("warehouse_id", None),
|
|
4616
|
+
)
|
|
5645
4617
|
|
|
5646
|
-
options: Optional[Any] = None
|
|
5647
|
-
"""Exclusively used for storing a list parameter definitions. A parameter is an object with
|
|
5648
|
-
`title`, `name`, `type`, and `value` properties. The `value` field here is the default value. It
|
|
5649
|
-
can be overridden at runtime."""
|
|
5650
4618
|
|
|
5651
|
-
|
|
5652
|
-
|
|
4619
|
+
@dataclass
|
|
4620
|
+
class QueryBackedValue:
|
|
4621
|
+
multi_values_options: Optional[MultiValuesOptions] = None
|
|
4622
|
+
"""If specified, allows multiple values to be selected for this parameter."""
|
|
5653
4623
|
|
|
5654
4624
|
query_id: Optional[str] = None
|
|
4625
|
+
"""UUID of the query that provides the parameter values."""
|
|
5655
4626
|
|
|
5656
|
-
|
|
5657
|
-
"""
|
|
5658
|
-
viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
|
|
5659
|
-
|
|
5660
|
-
tags: Optional[List[str]] = None
|
|
4627
|
+
values: Optional[List[str]] = None
|
|
4628
|
+
"""List of selected query parameter values."""
|
|
5661
4629
|
|
|
5662
4630
|
def as_dict(self) -> dict:
|
|
5663
|
-
"""Serializes the
|
|
4631
|
+
"""Serializes the QueryBackedValue into a dictionary suitable for use as a JSON request body."""
|
|
5664
4632
|
body = {}
|
|
5665
|
-
if self.
|
|
5666
|
-
body["
|
|
5667
|
-
if self.description is not None:
|
|
5668
|
-
body["description"] = self.description
|
|
5669
|
-
if self.name is not None:
|
|
5670
|
-
body["name"] = self.name
|
|
5671
|
-
if self.options:
|
|
5672
|
-
body["options"] = self.options
|
|
5673
|
-
if self.query is not None:
|
|
5674
|
-
body["query"] = self.query
|
|
4633
|
+
if self.multi_values_options:
|
|
4634
|
+
body["multi_values_options"] = self.multi_values_options.as_dict()
|
|
5675
4635
|
if self.query_id is not None:
|
|
5676
4636
|
body["query_id"] = self.query_id
|
|
5677
|
-
if self.
|
|
5678
|
-
body["
|
|
5679
|
-
if self.tags:
|
|
5680
|
-
body["tags"] = [v for v in self.tags]
|
|
4637
|
+
if self.values:
|
|
4638
|
+
body["values"] = [v for v in self.values]
|
|
5681
4639
|
return body
|
|
5682
4640
|
|
|
5683
4641
|
def as_shallow_dict(self) -> dict:
|
|
5684
|
-
"""Serializes the
|
|
4642
|
+
"""Serializes the QueryBackedValue into a shallow dictionary of its immediate attributes."""
|
|
5685
4643
|
body = {}
|
|
5686
|
-
if self.
|
|
5687
|
-
body["
|
|
5688
|
-
if self.description is not None:
|
|
5689
|
-
body["description"] = self.description
|
|
5690
|
-
if self.name is not None:
|
|
5691
|
-
body["name"] = self.name
|
|
5692
|
-
if self.options:
|
|
5693
|
-
body["options"] = self.options
|
|
5694
|
-
if self.query is not None:
|
|
5695
|
-
body["query"] = self.query
|
|
4644
|
+
if self.multi_values_options:
|
|
4645
|
+
body["multi_values_options"] = self.multi_values_options
|
|
5696
4646
|
if self.query_id is not None:
|
|
5697
4647
|
body["query_id"] = self.query_id
|
|
5698
|
-
if self.
|
|
5699
|
-
body["
|
|
5700
|
-
if self.tags:
|
|
5701
|
-
body["tags"] = self.tags
|
|
4648
|
+
if self.values:
|
|
4649
|
+
body["values"] = self.values
|
|
5702
4650
|
return body
|
|
5703
4651
|
|
|
5704
4652
|
@classmethod
|
|
5705
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
5706
|
-
"""Deserializes the
|
|
4653
|
+
def from_dict(cls, d: Dict[str, Any]) -> QueryBackedValue:
|
|
4654
|
+
"""Deserializes the QueryBackedValue from a dictionary."""
|
|
5707
4655
|
return cls(
|
|
5708
|
-
|
|
5709
|
-
description=d.get("description", None),
|
|
5710
|
-
name=d.get("name", None),
|
|
5711
|
-
options=d.get("options", None),
|
|
5712
|
-
query=d.get("query", None),
|
|
4656
|
+
multi_values_options=_from_dict(d, "multi_values_options", MultiValuesOptions),
|
|
5713
4657
|
query_id=d.get("query_id", None),
|
|
5714
|
-
|
|
5715
|
-
tags=d.get("tags", None),
|
|
4658
|
+
values=d.get("values", None),
|
|
5716
4659
|
)
|
|
5717
4660
|
|
|
5718
4661
|
|
|
@@ -6071,6 +5014,9 @@ class QueryMetrics:
|
|
|
6071
5014
|
photon_total_time_ms: Optional[int] = None
|
|
6072
5015
|
"""Total execution time for all individual Photon query engine tasks in the query, in milliseconds."""
|
|
6073
5016
|
|
|
5017
|
+
projected_remaining_task_total_time_ms: Optional[int] = None
|
|
5018
|
+
"""projected remaining work to be done aggregated across all stages in the query, in milliseconds"""
|
|
5019
|
+
|
|
6074
5020
|
provisioning_queue_start_timestamp: Optional[int] = None
|
|
6075
5021
|
"""Timestamp of when the query was enqueued waiting for a cluster to be provisioned for the
|
|
6076
5022
|
warehouse. This field is optional and will not appear if the query skipped the provisioning
|
|
@@ -6100,6 +5046,10 @@ class QueryMetrics:
|
|
|
6100
5046
|
read_remote_bytes: Optional[int] = None
|
|
6101
5047
|
"""Size of persistent data read from cloud object storage on your cloud tenant, in bytes."""
|
|
6102
5048
|
|
|
5049
|
+
remaining_task_count: Optional[int] = None
|
|
5050
|
+
"""number of remaining tasks to complete this is based on the current status and could be bigger or
|
|
5051
|
+
smaller in the future based on future updates"""
|
|
5052
|
+
|
|
6103
5053
|
result_fetch_time_ms: Optional[int] = None
|
|
6104
5054
|
"""Time spent fetching the query results after the execution finished, in milliseconds."""
|
|
6105
5055
|
|
|
@@ -6112,6 +5062,10 @@ class QueryMetrics:
|
|
|
6112
5062
|
rows_read_count: Optional[int] = None
|
|
6113
5063
|
"""Total number of rows read by the query."""
|
|
6114
5064
|
|
|
5065
|
+
runnable_tasks: Optional[int] = None
|
|
5066
|
+
"""number of remaining tasks to complete, calculated by autoscaler StatementAnalysis.scala
|
|
5067
|
+
deprecated: use remaining_task_count instead"""
|
|
5068
|
+
|
|
6115
5069
|
spill_to_disk_bytes: Optional[int] = None
|
|
6116
5070
|
"""Size of data temporarily written to disk while executing the query, in bytes."""
|
|
6117
5071
|
|
|
@@ -6125,6 +5079,11 @@ class QueryMetrics:
|
|
|
6125
5079
|
total_time_ms: Optional[int] = None
|
|
6126
5080
|
"""Total execution time of the query from the client’s point of view, in milliseconds."""
|
|
6127
5081
|
|
|
5082
|
+
work_to_be_done: Optional[int] = None
|
|
5083
|
+
"""remaining work to be done across all stages in the query, calculated by autoscaler
|
|
5084
|
+
StatementAnalysis.scala, in milliseconds deprecated: using
|
|
5085
|
+
projected_remaining_task_total_time_ms instead"""
|
|
5086
|
+
|
|
6128
5087
|
write_remote_bytes: Optional[int] = None
|
|
6129
5088
|
"""Size pf persistent data written to cloud object storage in your cloud tenant, in bytes."""
|
|
6130
5089
|
|
|
@@ -6141,6 +5100,8 @@ class QueryMetrics:
|
|
|
6141
5100
|
body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp
|
|
6142
5101
|
if self.photon_total_time_ms is not None:
|
|
6143
5102
|
body["photon_total_time_ms"] = self.photon_total_time_ms
|
|
5103
|
+
if self.projected_remaining_task_total_time_ms is not None:
|
|
5104
|
+
body["projected_remaining_task_total_time_ms"] = self.projected_remaining_task_total_time_ms
|
|
6144
5105
|
if self.provisioning_queue_start_timestamp is not None:
|
|
6145
5106
|
body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp
|
|
6146
5107
|
if self.pruned_bytes is not None:
|
|
@@ -6159,6 +5120,8 @@ class QueryMetrics:
|
|
|
6159
5120
|
body["read_partitions_count"] = self.read_partitions_count
|
|
6160
5121
|
if self.read_remote_bytes is not None:
|
|
6161
5122
|
body["read_remote_bytes"] = self.read_remote_bytes
|
|
5123
|
+
if self.remaining_task_count is not None:
|
|
5124
|
+
body["remaining_task_count"] = self.remaining_task_count
|
|
6162
5125
|
if self.result_fetch_time_ms is not None:
|
|
6163
5126
|
body["result_fetch_time_ms"] = self.result_fetch_time_ms
|
|
6164
5127
|
if self.result_from_cache is not None:
|
|
@@ -6167,6 +5130,8 @@ class QueryMetrics:
|
|
|
6167
5130
|
body["rows_produced_count"] = self.rows_produced_count
|
|
6168
5131
|
if self.rows_read_count is not None:
|
|
6169
5132
|
body["rows_read_count"] = self.rows_read_count
|
|
5133
|
+
if self.runnable_tasks is not None:
|
|
5134
|
+
body["runnable_tasks"] = self.runnable_tasks
|
|
6170
5135
|
if self.spill_to_disk_bytes is not None:
|
|
6171
5136
|
body["spill_to_disk_bytes"] = self.spill_to_disk_bytes
|
|
6172
5137
|
if self.task_time_over_time_range:
|
|
@@ -6175,6 +5140,8 @@ class QueryMetrics:
|
|
|
6175
5140
|
body["task_total_time_ms"] = self.task_total_time_ms
|
|
6176
5141
|
if self.total_time_ms is not None:
|
|
6177
5142
|
body["total_time_ms"] = self.total_time_ms
|
|
5143
|
+
if self.work_to_be_done is not None:
|
|
5144
|
+
body["work_to_be_done"] = self.work_to_be_done
|
|
6178
5145
|
if self.write_remote_bytes is not None:
|
|
6179
5146
|
body["write_remote_bytes"] = self.write_remote_bytes
|
|
6180
5147
|
return body
|
|
@@ -6192,6 +5159,8 @@ class QueryMetrics:
|
|
|
6192
5159
|
body["overloading_queue_start_timestamp"] = self.overloading_queue_start_timestamp
|
|
6193
5160
|
if self.photon_total_time_ms is not None:
|
|
6194
5161
|
body["photon_total_time_ms"] = self.photon_total_time_ms
|
|
5162
|
+
if self.projected_remaining_task_total_time_ms is not None:
|
|
5163
|
+
body["projected_remaining_task_total_time_ms"] = self.projected_remaining_task_total_time_ms
|
|
6195
5164
|
if self.provisioning_queue_start_timestamp is not None:
|
|
6196
5165
|
body["provisioning_queue_start_timestamp"] = self.provisioning_queue_start_timestamp
|
|
6197
5166
|
if self.pruned_bytes is not None:
|
|
@@ -6210,6 +5179,8 @@ class QueryMetrics:
|
|
|
6210
5179
|
body["read_partitions_count"] = self.read_partitions_count
|
|
6211
5180
|
if self.read_remote_bytes is not None:
|
|
6212
5181
|
body["read_remote_bytes"] = self.read_remote_bytes
|
|
5182
|
+
if self.remaining_task_count is not None:
|
|
5183
|
+
body["remaining_task_count"] = self.remaining_task_count
|
|
6213
5184
|
if self.result_fetch_time_ms is not None:
|
|
6214
5185
|
body["result_fetch_time_ms"] = self.result_fetch_time_ms
|
|
6215
5186
|
if self.result_from_cache is not None:
|
|
@@ -6218,6 +5189,8 @@ class QueryMetrics:
|
|
|
6218
5189
|
body["rows_produced_count"] = self.rows_produced_count
|
|
6219
5190
|
if self.rows_read_count is not None:
|
|
6220
5191
|
body["rows_read_count"] = self.rows_read_count
|
|
5192
|
+
if self.runnable_tasks is not None:
|
|
5193
|
+
body["runnable_tasks"] = self.runnable_tasks
|
|
6221
5194
|
if self.spill_to_disk_bytes is not None:
|
|
6222
5195
|
body["spill_to_disk_bytes"] = self.spill_to_disk_bytes
|
|
6223
5196
|
if self.task_time_over_time_range:
|
|
@@ -6226,6 +5199,8 @@ class QueryMetrics:
|
|
|
6226
5199
|
body["task_total_time_ms"] = self.task_total_time_ms
|
|
6227
5200
|
if self.total_time_ms is not None:
|
|
6228
5201
|
body["total_time_ms"] = self.total_time_ms
|
|
5202
|
+
if self.work_to_be_done is not None:
|
|
5203
|
+
body["work_to_be_done"] = self.work_to_be_done
|
|
6229
5204
|
if self.write_remote_bytes is not None:
|
|
6230
5205
|
body["write_remote_bytes"] = self.write_remote_bytes
|
|
6231
5206
|
return body
|
|
@@ -6239,6 +5214,7 @@ class QueryMetrics:
|
|
|
6239
5214
|
network_sent_bytes=d.get("network_sent_bytes", None),
|
|
6240
5215
|
overloading_queue_start_timestamp=d.get("overloading_queue_start_timestamp", None),
|
|
6241
5216
|
photon_total_time_ms=d.get("photon_total_time_ms", None),
|
|
5217
|
+
projected_remaining_task_total_time_ms=d.get("projected_remaining_task_total_time_ms", None),
|
|
6242
5218
|
provisioning_queue_start_timestamp=d.get("provisioning_queue_start_timestamp", None),
|
|
6243
5219
|
pruned_bytes=d.get("pruned_bytes", None),
|
|
6244
5220
|
pruned_files_count=d.get("pruned_files_count", None),
|
|
@@ -6248,14 +5224,17 @@ class QueryMetrics:
|
|
|
6248
5224
|
read_files_count=d.get("read_files_count", None),
|
|
6249
5225
|
read_partitions_count=d.get("read_partitions_count", None),
|
|
6250
5226
|
read_remote_bytes=d.get("read_remote_bytes", None),
|
|
5227
|
+
remaining_task_count=d.get("remaining_task_count", None),
|
|
6251
5228
|
result_fetch_time_ms=d.get("result_fetch_time_ms", None),
|
|
6252
5229
|
result_from_cache=d.get("result_from_cache", None),
|
|
6253
5230
|
rows_produced_count=d.get("rows_produced_count", None),
|
|
6254
5231
|
rows_read_count=d.get("rows_read_count", None),
|
|
5232
|
+
runnable_tasks=d.get("runnable_tasks", None),
|
|
6255
5233
|
spill_to_disk_bytes=d.get("spill_to_disk_bytes", None),
|
|
6256
5234
|
task_time_over_time_range=_from_dict(d, "task_time_over_time_range", TaskTimeOverRange),
|
|
6257
5235
|
task_total_time_ms=d.get("task_total_time_ms", None),
|
|
6258
5236
|
total_time_ms=d.get("total_time_ms", None),
|
|
5237
|
+
work_to_be_done=d.get("work_to_be_done", None),
|
|
6259
5238
|
write_remote_bytes=d.get("write_remote_bytes", None),
|
|
6260
5239
|
)
|
|
6261
5240
|
|
|
@@ -6395,94 +5374,6 @@ class QueryParameter:
|
|
|
6395
5374
|
)
|
|
6396
5375
|
|
|
6397
5376
|
|
|
6398
|
-
@dataclass
|
|
6399
|
-
class QueryPostContent:
|
|
6400
|
-
data_source_id: Optional[str] = None
|
|
6401
|
-
"""Data source ID maps to the ID of the data source used by the resource and is distinct from the
|
|
6402
|
-
warehouse ID. [Learn more]
|
|
6403
|
-
|
|
6404
|
-
[Learn more]: https://docs.databricks.com/api/workspace/datasources/list"""
|
|
6405
|
-
|
|
6406
|
-
description: Optional[str] = None
|
|
6407
|
-
"""General description that conveys additional information about this query such as usage notes."""
|
|
6408
|
-
|
|
6409
|
-
name: Optional[str] = None
|
|
6410
|
-
"""The title of this query that appears in list views, widget headings, and on the query page."""
|
|
6411
|
-
|
|
6412
|
-
options: Optional[Any] = None
|
|
6413
|
-
"""Exclusively used for storing a list parameter definitions. A parameter is an object with
|
|
6414
|
-
`title`, `name`, `type`, and `value` properties. The `value` field here is the default value. It
|
|
6415
|
-
can be overridden at runtime."""
|
|
6416
|
-
|
|
6417
|
-
parent: Optional[str] = None
|
|
6418
|
-
"""The identifier of the workspace folder containing the object."""
|
|
6419
|
-
|
|
6420
|
-
query: Optional[str] = None
|
|
6421
|
-
"""The text of the query to be run."""
|
|
6422
|
-
|
|
6423
|
-
run_as_role: Optional[RunAsRole] = None
|
|
6424
|
-
"""Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
|
|
6425
|
-
viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
|
|
6426
|
-
|
|
6427
|
-
tags: Optional[List[str]] = None
|
|
6428
|
-
|
|
6429
|
-
def as_dict(self) -> dict:
|
|
6430
|
-
"""Serializes the QueryPostContent into a dictionary suitable for use as a JSON request body."""
|
|
6431
|
-
body = {}
|
|
6432
|
-
if self.data_source_id is not None:
|
|
6433
|
-
body["data_source_id"] = self.data_source_id
|
|
6434
|
-
if self.description is not None:
|
|
6435
|
-
body["description"] = self.description
|
|
6436
|
-
if self.name is not None:
|
|
6437
|
-
body["name"] = self.name
|
|
6438
|
-
if self.options:
|
|
6439
|
-
body["options"] = self.options
|
|
6440
|
-
if self.parent is not None:
|
|
6441
|
-
body["parent"] = self.parent
|
|
6442
|
-
if self.query is not None:
|
|
6443
|
-
body["query"] = self.query
|
|
6444
|
-
if self.run_as_role is not None:
|
|
6445
|
-
body["run_as_role"] = self.run_as_role.value
|
|
6446
|
-
if self.tags:
|
|
6447
|
-
body["tags"] = [v for v in self.tags]
|
|
6448
|
-
return body
|
|
6449
|
-
|
|
6450
|
-
def as_shallow_dict(self) -> dict:
|
|
6451
|
-
"""Serializes the QueryPostContent into a shallow dictionary of its immediate attributes."""
|
|
6452
|
-
body = {}
|
|
6453
|
-
if self.data_source_id is not None:
|
|
6454
|
-
body["data_source_id"] = self.data_source_id
|
|
6455
|
-
if self.description is not None:
|
|
6456
|
-
body["description"] = self.description
|
|
6457
|
-
if self.name is not None:
|
|
6458
|
-
body["name"] = self.name
|
|
6459
|
-
if self.options:
|
|
6460
|
-
body["options"] = self.options
|
|
6461
|
-
if self.parent is not None:
|
|
6462
|
-
body["parent"] = self.parent
|
|
6463
|
-
if self.query is not None:
|
|
6464
|
-
body["query"] = self.query
|
|
6465
|
-
if self.run_as_role is not None:
|
|
6466
|
-
body["run_as_role"] = self.run_as_role
|
|
6467
|
-
if self.tags:
|
|
6468
|
-
body["tags"] = self.tags
|
|
6469
|
-
return body
|
|
6470
|
-
|
|
6471
|
-
@classmethod
|
|
6472
|
-
def from_dict(cls, d: Dict[str, Any]) -> QueryPostContent:
|
|
6473
|
-
"""Deserializes the QueryPostContent from a dictionary."""
|
|
6474
|
-
return cls(
|
|
6475
|
-
data_source_id=d.get("data_source_id", None),
|
|
6476
|
-
description=d.get("description", None),
|
|
6477
|
-
name=d.get("name", None),
|
|
6478
|
-
options=d.get("options", None),
|
|
6479
|
-
parent=d.get("parent", None),
|
|
6480
|
-
query=d.get("query", None),
|
|
6481
|
-
run_as_role=_enum(d, "run_as_role", RunAsRole),
|
|
6482
|
-
tags=d.get("tags", None),
|
|
6483
|
-
)
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
5377
|
class QueryStatementType(Enum):
|
|
6487
5378
|
|
|
6488
5379
|
ALTER = "ALTER"
|
|
@@ -6672,7 +5563,6 @@ class ResultManifest:
|
|
|
6672
5563
|
format: Optional[Format] = None
|
|
6673
5564
|
|
|
6674
5565
|
schema: Optional[ResultSchema] = None
|
|
6675
|
-
"""The schema is an ordered list of column descriptions."""
|
|
6676
5566
|
|
|
6677
5567
|
total_byte_count: Optional[int] = None
|
|
6678
5568
|
"""The total number of bytes in the result set. This field is not available when using `INLINE`
|
|
@@ -6778,8 +5668,6 @@ class RunAsMode(Enum):
|
|
|
6778
5668
|
|
|
6779
5669
|
|
|
6780
5670
|
class RunAsRole(Enum):
|
|
6781
|
-
"""Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
|
|
6782
|
-
viewer" behavior) or `"owner"` (signifying "run as owner" behavior)"""
|
|
6783
5671
|
|
|
6784
5672
|
OWNER = "owner"
|
|
6785
5673
|
VIEWER = "viewer"
|
|
@@ -6840,50 +5728,6 @@ class ServiceErrorCode(Enum):
|
|
|
6840
5728
|
WORKSPACE_TEMPORARILY_UNAVAILABLE = "WORKSPACE_TEMPORARILY_UNAVAILABLE"
|
|
6841
5729
|
|
|
6842
5730
|
|
|
6843
|
-
@dataclass
|
|
6844
|
-
class SetRequest:
|
|
6845
|
-
"""Set object ACL"""
|
|
6846
|
-
|
|
6847
|
-
access_control_list: Optional[List[AccessControl]] = None
|
|
6848
|
-
|
|
6849
|
-
object_id: Optional[str] = None
|
|
6850
|
-
"""Object ID. The ACL for the object with this UUID is overwritten by this request's POST content."""
|
|
6851
|
-
|
|
6852
|
-
object_type: Optional[ObjectTypePlural] = None
|
|
6853
|
-
"""The type of object permission to set."""
|
|
6854
|
-
|
|
6855
|
-
def as_dict(self) -> dict:
|
|
6856
|
-
"""Serializes the SetRequest into a dictionary suitable for use as a JSON request body."""
|
|
6857
|
-
body = {}
|
|
6858
|
-
if self.access_control_list:
|
|
6859
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
6860
|
-
if self.object_id is not None:
|
|
6861
|
-
body["objectId"] = self.object_id
|
|
6862
|
-
if self.object_type is not None:
|
|
6863
|
-
body["objectType"] = self.object_type.value
|
|
6864
|
-
return body
|
|
6865
|
-
|
|
6866
|
-
def as_shallow_dict(self) -> dict:
|
|
6867
|
-
"""Serializes the SetRequest into a shallow dictionary of its immediate attributes."""
|
|
6868
|
-
body = {}
|
|
6869
|
-
if self.access_control_list:
|
|
6870
|
-
body["access_control_list"] = self.access_control_list
|
|
6871
|
-
if self.object_id is not None:
|
|
6872
|
-
body["objectId"] = self.object_id
|
|
6873
|
-
if self.object_type is not None:
|
|
6874
|
-
body["objectType"] = self.object_type
|
|
6875
|
-
return body
|
|
6876
|
-
|
|
6877
|
-
@classmethod
|
|
6878
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetRequest:
|
|
6879
|
-
"""Deserializes the SetRequest from a dictionary."""
|
|
6880
|
-
return cls(
|
|
6881
|
-
access_control_list=_repeated_dict(d, "access_control_list", AccessControl),
|
|
6882
|
-
object_id=d.get("objectId", None),
|
|
6883
|
-
object_type=_enum(d, "objectType", ObjectTypePlural),
|
|
6884
|
-
)
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
5731
|
@dataclass
|
|
6888
5732
|
class SetResponse:
|
|
6889
5733
|
access_control_list: Optional[List[AccessControl]] = None
|
|
@@ -6891,134 +5735,38 @@ class SetResponse:
|
|
|
6891
5735
|
object_id: Optional[str] = None
|
|
6892
5736
|
"""An object's type and UUID, separated by a forward slash (/) character."""
|
|
6893
5737
|
|
|
6894
|
-
object_type: Optional[ObjectType] = None
|
|
6895
|
-
"""A singular noun object type."""
|
|
6896
|
-
|
|
6897
|
-
def as_dict(self) -> dict:
|
|
6898
|
-
"""Serializes the SetResponse into a dictionary suitable for use as a JSON request body."""
|
|
6899
|
-
body = {}
|
|
6900
|
-
if self.access_control_list:
|
|
6901
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
6902
|
-
if self.object_id is not None:
|
|
6903
|
-
body["object_id"] = self.object_id
|
|
6904
|
-
if self.object_type is not None:
|
|
6905
|
-
body["object_type"] = self.object_type.value
|
|
6906
|
-
return body
|
|
6907
|
-
|
|
6908
|
-
def as_shallow_dict(self) -> dict:
|
|
6909
|
-
"""Serializes the SetResponse into a shallow dictionary of its immediate attributes."""
|
|
6910
|
-
body = {}
|
|
6911
|
-
if self.access_control_list:
|
|
6912
|
-
body["access_control_list"] = self.access_control_list
|
|
6913
|
-
if self.object_id is not None:
|
|
6914
|
-
body["object_id"] = self.object_id
|
|
6915
|
-
if self.object_type is not None:
|
|
6916
|
-
body["object_type"] = self.object_type
|
|
6917
|
-
return body
|
|
6918
|
-
|
|
6919
|
-
@classmethod
|
|
6920
|
-
def from_dict(cls, d: Dict[str, Any]) -> SetResponse:
|
|
6921
|
-
"""Deserializes the SetResponse from a dictionary."""
|
|
6922
|
-
return cls(
|
|
6923
|
-
access_control_list=_repeated_dict(d, "access_control_list", AccessControl),
|
|
6924
|
-
object_id=d.get("object_id", None),
|
|
6925
|
-
object_type=_enum(d, "object_type", ObjectType),
|
|
6926
|
-
)
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
@dataclass
|
|
6930
|
-
class SetWorkspaceWarehouseConfigRequest:
|
|
6931
|
-
channel: Optional[Channel] = None
|
|
6932
|
-
"""Optional: Channel selection details"""
|
|
6933
|
-
|
|
6934
|
-
config_param: Optional[RepeatedEndpointConfPairs] = None
|
|
6935
|
-
"""Deprecated: Use sql_configuration_parameters"""
|
|
6936
|
-
|
|
6937
|
-
data_access_config: Optional[List[EndpointConfPair]] = None
|
|
6938
|
-
"""Spark confs for external hive metastore configuration JSON serialized size must be less than <=
|
|
6939
|
-
512K"""
|
|
6940
|
-
|
|
6941
|
-
enabled_warehouse_types: Optional[List[WarehouseTypePair]] = None
|
|
6942
|
-
"""List of Warehouse Types allowed in this workspace (limits allowed value of the type field in
|
|
6943
|
-
CreateWarehouse and EditWarehouse). Note: Some types cannot be disabled, they don't need to be
|
|
6944
|
-
specified in SetWorkspaceWarehouseConfig. Note: Disabling a type may cause existing warehouses
|
|
6945
|
-
to be converted to another type. Used by frontend to save specific type availability in the
|
|
6946
|
-
warehouse create and edit form UI."""
|
|
6947
|
-
|
|
6948
|
-
global_param: Optional[RepeatedEndpointConfPairs] = None
|
|
6949
|
-
"""Deprecated: Use sql_configuration_parameters"""
|
|
6950
|
-
|
|
6951
|
-
google_service_account: Optional[str] = None
|
|
6952
|
-
"""GCP only: Google Service Account used to pass to cluster to access Google Cloud Storage"""
|
|
6953
|
-
|
|
6954
|
-
instance_profile_arn: Optional[str] = None
|
|
6955
|
-
"""AWS Only: Instance profile used to pass IAM role to the cluster"""
|
|
6956
|
-
|
|
6957
|
-
security_policy: Optional[SetWorkspaceWarehouseConfigRequestSecurityPolicy] = None
|
|
6958
|
-
"""Security policy for warehouses"""
|
|
6959
|
-
|
|
6960
|
-
sql_configuration_parameters: Optional[RepeatedEndpointConfPairs] = None
|
|
6961
|
-
"""SQL configuration parameters"""
|
|
6962
|
-
|
|
5738
|
+
object_type: Optional[ObjectType] = None
|
|
5739
|
+
"""A singular noun object type."""
|
|
5740
|
+
|
|
6963
5741
|
def as_dict(self) -> dict:
|
|
6964
|
-
"""Serializes the
|
|
5742
|
+
"""Serializes the SetResponse into a dictionary suitable for use as a JSON request body."""
|
|
6965
5743
|
body = {}
|
|
6966
|
-
if self.
|
|
6967
|
-
body["
|
|
6968
|
-
if self.
|
|
6969
|
-
body["
|
|
6970
|
-
if self.
|
|
6971
|
-
body["
|
|
6972
|
-
if self.enabled_warehouse_types:
|
|
6973
|
-
body["enabled_warehouse_types"] = [v.as_dict() for v in self.enabled_warehouse_types]
|
|
6974
|
-
if self.global_param:
|
|
6975
|
-
body["global_param"] = self.global_param.as_dict()
|
|
6976
|
-
if self.google_service_account is not None:
|
|
6977
|
-
body["google_service_account"] = self.google_service_account
|
|
6978
|
-
if self.instance_profile_arn is not None:
|
|
6979
|
-
body["instance_profile_arn"] = self.instance_profile_arn
|
|
6980
|
-
if self.security_policy is not None:
|
|
6981
|
-
body["security_policy"] = self.security_policy.value
|
|
6982
|
-
if self.sql_configuration_parameters:
|
|
6983
|
-
body["sql_configuration_parameters"] = self.sql_configuration_parameters.as_dict()
|
|
5744
|
+
if self.access_control_list:
|
|
5745
|
+
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
5746
|
+
if self.object_id is not None:
|
|
5747
|
+
body["object_id"] = self.object_id
|
|
5748
|
+
if self.object_type is not None:
|
|
5749
|
+
body["object_type"] = self.object_type.value
|
|
6984
5750
|
return body
|
|
6985
5751
|
|
|
6986
5752
|
def as_shallow_dict(self) -> dict:
|
|
6987
|
-
"""Serializes the
|
|
5753
|
+
"""Serializes the SetResponse into a shallow dictionary of its immediate attributes."""
|
|
6988
5754
|
body = {}
|
|
6989
|
-
if self.
|
|
6990
|
-
body["
|
|
6991
|
-
if self.
|
|
6992
|
-
body["
|
|
6993
|
-
if self.
|
|
6994
|
-
body["
|
|
6995
|
-
if self.enabled_warehouse_types:
|
|
6996
|
-
body["enabled_warehouse_types"] = self.enabled_warehouse_types
|
|
6997
|
-
if self.global_param:
|
|
6998
|
-
body["global_param"] = self.global_param
|
|
6999
|
-
if self.google_service_account is not None:
|
|
7000
|
-
body["google_service_account"] = self.google_service_account
|
|
7001
|
-
if self.instance_profile_arn is not None:
|
|
7002
|
-
body["instance_profile_arn"] = self.instance_profile_arn
|
|
7003
|
-
if self.security_policy is not None:
|
|
7004
|
-
body["security_policy"] = self.security_policy
|
|
7005
|
-
if self.sql_configuration_parameters:
|
|
7006
|
-
body["sql_configuration_parameters"] = self.sql_configuration_parameters
|
|
5755
|
+
if self.access_control_list:
|
|
5756
|
+
body["access_control_list"] = self.access_control_list
|
|
5757
|
+
if self.object_id is not None:
|
|
5758
|
+
body["object_id"] = self.object_id
|
|
5759
|
+
if self.object_type is not None:
|
|
5760
|
+
body["object_type"] = self.object_type
|
|
7007
5761
|
return body
|
|
7008
5762
|
|
|
7009
5763
|
@classmethod
|
|
7010
|
-
def from_dict(cls, d: Dict[str, Any]) ->
|
|
7011
|
-
"""Deserializes the
|
|
5764
|
+
def from_dict(cls, d: Dict[str, Any]) -> SetResponse:
|
|
5765
|
+
"""Deserializes the SetResponse from a dictionary."""
|
|
7012
5766
|
return cls(
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
enabled_warehouse_types=_repeated_dict(d, "enabled_warehouse_types", WarehouseTypePair),
|
|
7017
|
-
global_param=_from_dict(d, "global_param", RepeatedEndpointConfPairs),
|
|
7018
|
-
google_service_account=d.get("google_service_account", None),
|
|
7019
|
-
instance_profile_arn=d.get("instance_profile_arn", None),
|
|
7020
|
-
security_policy=_enum(d, "security_policy", SetWorkspaceWarehouseConfigRequestSecurityPolicy),
|
|
7021
|
-
sql_configuration_parameters=_from_dict(d, "sql_configuration_parameters", RepeatedEndpointConfPairs),
|
|
5767
|
+
access_control_list=_repeated_dict(d, "access_control_list", AccessControl),
|
|
5768
|
+
object_id=d.get("object_id", None),
|
|
5769
|
+
object_type=_enum(d, "object_type", ObjectType),
|
|
7022
5770
|
)
|
|
7023
5771
|
|
|
7024
5772
|
|
|
@@ -7132,7 +5880,6 @@ class StatementParameterListItem:
|
|
|
7132
5880
|
@dataclass
|
|
7133
5881
|
class StatementResponse:
|
|
7134
5882
|
manifest: Optional[ResultManifest] = None
|
|
7135
|
-
"""The result manifest provides schema and metadata for the result set."""
|
|
7136
5883
|
|
|
7137
5884
|
result: Optional[ResultData] = None
|
|
7138
5885
|
|
|
@@ -7141,7 +5888,6 @@ class StatementResponse:
|
|
|
7141
5888
|
reference for all subsequent calls."""
|
|
7142
5889
|
|
|
7143
5890
|
status: Optional[StatementStatus] = None
|
|
7144
|
-
"""The status response includes execution state and if relevant, error information."""
|
|
7145
5891
|
|
|
7146
5892
|
def as_dict(self) -> dict:
|
|
7147
5893
|
"""Serializes the StatementResponse into a dictionary suitable for use as a JSON request body."""
|
|
@@ -7202,11 +5948,6 @@ class StatementStatus:
|
|
|
7202
5948
|
error: Optional[ServiceError] = None
|
|
7203
5949
|
|
|
7204
5950
|
state: Optional[StatementState] = None
|
|
7205
|
-
"""Statement execution state: - `PENDING`: waiting for warehouse - `RUNNING`: running -
|
|
7206
|
-
`SUCCEEDED`: execution was successful, result data available for fetch - `FAILED`: execution
|
|
7207
|
-
failed; reason for failure described in accomanying error message - `CANCELED`: user canceled;
|
|
7208
|
-
can come from explicit cancel call, or timeout with `on_wait_timeout=CANCEL` - `CLOSED`:
|
|
7209
|
-
execution successful, and statement closed; result no longer available for fetch"""
|
|
7210
5951
|
|
|
7211
5952
|
def as_dict(self) -> dict:
|
|
7212
5953
|
"""Serializes the StatementStatus into a dictionary suitable for use as a JSON request body."""
|
|
@@ -7562,109 +6303,6 @@ class TransferOwnershipObjectId:
|
|
|
7562
6303
|
return cls(new_owner=d.get("new_owner", None))
|
|
7563
6304
|
|
|
7564
6305
|
|
|
7565
|
-
@dataclass
|
|
7566
|
-
class TransferOwnershipRequest:
|
|
7567
|
-
"""Transfer object ownership"""
|
|
7568
|
-
|
|
7569
|
-
new_owner: Optional[str] = None
|
|
7570
|
-
"""Email address for the new owner, who must exist in the workspace."""
|
|
7571
|
-
|
|
7572
|
-
object_id: Optional[TransferOwnershipObjectId] = None
|
|
7573
|
-
"""The ID of the object on which to change ownership."""
|
|
7574
|
-
|
|
7575
|
-
object_type: Optional[OwnableObjectType] = None
|
|
7576
|
-
"""The type of object on which to change ownership."""
|
|
7577
|
-
|
|
7578
|
-
def as_dict(self) -> dict:
|
|
7579
|
-
"""Serializes the TransferOwnershipRequest into a dictionary suitable for use as a JSON request body."""
|
|
7580
|
-
body = {}
|
|
7581
|
-
if self.new_owner is not None:
|
|
7582
|
-
body["new_owner"] = self.new_owner
|
|
7583
|
-
if self.object_id:
|
|
7584
|
-
body["objectId"] = self.object_id.as_dict()
|
|
7585
|
-
if self.object_type is not None:
|
|
7586
|
-
body["objectType"] = self.object_type.value
|
|
7587
|
-
return body
|
|
7588
|
-
|
|
7589
|
-
def as_shallow_dict(self) -> dict:
|
|
7590
|
-
"""Serializes the TransferOwnershipRequest into a shallow dictionary of its immediate attributes."""
|
|
7591
|
-
body = {}
|
|
7592
|
-
if self.new_owner is not None:
|
|
7593
|
-
body["new_owner"] = self.new_owner
|
|
7594
|
-
if self.object_id:
|
|
7595
|
-
body["objectId"] = self.object_id
|
|
7596
|
-
if self.object_type is not None:
|
|
7597
|
-
body["objectType"] = self.object_type
|
|
7598
|
-
return body
|
|
7599
|
-
|
|
7600
|
-
@classmethod
|
|
7601
|
-
def from_dict(cls, d: Dict[str, Any]) -> TransferOwnershipRequest:
|
|
7602
|
-
"""Deserializes the TransferOwnershipRequest from a dictionary."""
|
|
7603
|
-
return cls(
|
|
7604
|
-
new_owner=d.get("new_owner", None),
|
|
7605
|
-
object_id=_from_dict(d, "objectId", TransferOwnershipObjectId),
|
|
7606
|
-
object_type=_enum(d, "objectType", OwnableObjectType),
|
|
7607
|
-
)
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
@dataclass
|
|
7611
|
-
class UpdateAlertRequest:
|
|
7612
|
-
update_mask: str
|
|
7613
|
-
"""The field mask must be a single string, with multiple fields separated by commas (no spaces).
|
|
7614
|
-
The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields
|
|
7615
|
-
(e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed,
|
|
7616
|
-
as only the entire collection field can be specified. Field names must exactly match the
|
|
7617
|
-
resource field names.
|
|
7618
|
-
|
|
7619
|
-
A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
|
|
7620
|
-
fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the
|
|
7621
|
-
API changes in the future."""
|
|
7622
|
-
|
|
7623
|
-
alert: Optional[UpdateAlertRequestAlert] = None
|
|
7624
|
-
|
|
7625
|
-
auto_resolve_display_name: Optional[bool] = None
|
|
7626
|
-
"""If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
|
|
7627
|
-
alert's display name conflicts with an existing alert's display name."""
|
|
7628
|
-
|
|
7629
|
-
id: Optional[str] = None
|
|
7630
|
-
|
|
7631
|
-
def as_dict(self) -> dict:
|
|
7632
|
-
"""Serializes the UpdateAlertRequest into a dictionary suitable for use as a JSON request body."""
|
|
7633
|
-
body = {}
|
|
7634
|
-
if self.alert:
|
|
7635
|
-
body["alert"] = self.alert.as_dict()
|
|
7636
|
-
if self.auto_resolve_display_name is not None:
|
|
7637
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
7638
|
-
if self.id is not None:
|
|
7639
|
-
body["id"] = self.id
|
|
7640
|
-
if self.update_mask is not None:
|
|
7641
|
-
body["update_mask"] = self.update_mask
|
|
7642
|
-
return body
|
|
7643
|
-
|
|
7644
|
-
def as_shallow_dict(self) -> dict:
|
|
7645
|
-
"""Serializes the UpdateAlertRequest into a shallow dictionary of its immediate attributes."""
|
|
7646
|
-
body = {}
|
|
7647
|
-
if self.alert:
|
|
7648
|
-
body["alert"] = self.alert
|
|
7649
|
-
if self.auto_resolve_display_name is not None:
|
|
7650
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
7651
|
-
if self.id is not None:
|
|
7652
|
-
body["id"] = self.id
|
|
7653
|
-
if self.update_mask is not None:
|
|
7654
|
-
body["update_mask"] = self.update_mask
|
|
7655
|
-
return body
|
|
7656
|
-
|
|
7657
|
-
@classmethod
|
|
7658
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateAlertRequest:
|
|
7659
|
-
"""Deserializes the UpdateAlertRequest from a dictionary."""
|
|
7660
|
-
return cls(
|
|
7661
|
-
alert=_from_dict(d, "alert", UpdateAlertRequestAlert),
|
|
7662
|
-
auto_resolve_display_name=d.get("auto_resolve_display_name", None),
|
|
7663
|
-
id=d.get("id", None),
|
|
7664
|
-
update_mask=d.get("update_mask", None),
|
|
7665
|
-
)
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
6306
|
@dataclass
|
|
7669
6307
|
class UpdateAlertRequestAlert:
|
|
7670
6308
|
condition: Optional[AlertCondition] = None
|
|
@@ -7754,64 +6392,6 @@ class UpdateAlertRequestAlert:
|
|
|
7754
6392
|
)
|
|
7755
6393
|
|
|
7756
6394
|
|
|
7757
|
-
@dataclass
|
|
7758
|
-
class UpdateQueryRequest:
|
|
7759
|
-
update_mask: str
|
|
7760
|
-
"""The field mask must be a single string, with multiple fields separated by commas (no spaces).
|
|
7761
|
-
The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields
|
|
7762
|
-
(e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed,
|
|
7763
|
-
as only the entire collection field can be specified. Field names must exactly match the
|
|
7764
|
-
resource field names.
|
|
7765
|
-
|
|
7766
|
-
A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
|
|
7767
|
-
fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the
|
|
7768
|
-
API changes in the future."""
|
|
7769
|
-
|
|
7770
|
-
auto_resolve_display_name: Optional[bool] = None
|
|
7771
|
-
"""If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the
|
|
7772
|
-
alert's display name conflicts with an existing alert's display name."""
|
|
7773
|
-
|
|
7774
|
-
id: Optional[str] = None
|
|
7775
|
-
|
|
7776
|
-
query: Optional[UpdateQueryRequestQuery] = None
|
|
7777
|
-
|
|
7778
|
-
def as_dict(self) -> dict:
|
|
7779
|
-
"""Serializes the UpdateQueryRequest into a dictionary suitable for use as a JSON request body."""
|
|
7780
|
-
body = {}
|
|
7781
|
-
if self.auto_resolve_display_name is not None:
|
|
7782
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
7783
|
-
if self.id is not None:
|
|
7784
|
-
body["id"] = self.id
|
|
7785
|
-
if self.query:
|
|
7786
|
-
body["query"] = self.query.as_dict()
|
|
7787
|
-
if self.update_mask is not None:
|
|
7788
|
-
body["update_mask"] = self.update_mask
|
|
7789
|
-
return body
|
|
7790
|
-
|
|
7791
|
-
def as_shallow_dict(self) -> dict:
|
|
7792
|
-
"""Serializes the UpdateQueryRequest into a shallow dictionary of its immediate attributes."""
|
|
7793
|
-
body = {}
|
|
7794
|
-
if self.auto_resolve_display_name is not None:
|
|
7795
|
-
body["auto_resolve_display_name"] = self.auto_resolve_display_name
|
|
7796
|
-
if self.id is not None:
|
|
7797
|
-
body["id"] = self.id
|
|
7798
|
-
if self.query:
|
|
7799
|
-
body["query"] = self.query
|
|
7800
|
-
if self.update_mask is not None:
|
|
7801
|
-
body["update_mask"] = self.update_mask
|
|
7802
|
-
return body
|
|
7803
|
-
|
|
7804
|
-
@classmethod
|
|
7805
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateQueryRequest:
|
|
7806
|
-
"""Deserializes the UpdateQueryRequest from a dictionary."""
|
|
7807
|
-
return cls(
|
|
7808
|
-
auto_resolve_display_name=d.get("auto_resolve_display_name", None),
|
|
7809
|
-
id=d.get("id", None),
|
|
7810
|
-
query=_from_dict(d, "query", UpdateQueryRequestQuery),
|
|
7811
|
-
update_mask=d.get("update_mask", None),
|
|
7812
|
-
)
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
6395
|
@dataclass
|
|
7816
6396
|
class UpdateQueryRequestQuery:
|
|
7817
6397
|
apply_auto_limit: Optional[bool] = None
|
|
@@ -7936,55 +6516,6 @@ class UpdateResponse:
|
|
|
7936
6516
|
return cls()
|
|
7937
6517
|
|
|
7938
6518
|
|
|
7939
|
-
@dataclass
|
|
7940
|
-
class UpdateVisualizationRequest:
|
|
7941
|
-
update_mask: str
|
|
7942
|
-
"""The field mask must be a single string, with multiple fields separated by commas (no spaces).
|
|
7943
|
-
The field path is relative to the resource object, using a dot (`.`) to navigate sub-fields
|
|
7944
|
-
(e.g., `author.given_name`). Specification of elements in sequence or map fields is not allowed,
|
|
7945
|
-
as only the entire collection field can be specified. Field names must exactly match the
|
|
7946
|
-
resource field names.
|
|
7947
|
-
|
|
7948
|
-
A field mask of `*` indicates full replacement. It’s recommended to always explicitly list the
|
|
7949
|
-
fields being updated and avoid using `*` wildcards, as it can lead to unintended results if the
|
|
7950
|
-
API changes in the future."""
|
|
7951
|
-
|
|
7952
|
-
id: Optional[str] = None
|
|
7953
|
-
|
|
7954
|
-
visualization: Optional[UpdateVisualizationRequestVisualization] = None
|
|
7955
|
-
|
|
7956
|
-
def as_dict(self) -> dict:
|
|
7957
|
-
"""Serializes the UpdateVisualizationRequest into a dictionary suitable for use as a JSON request body."""
|
|
7958
|
-
body = {}
|
|
7959
|
-
if self.id is not None:
|
|
7960
|
-
body["id"] = self.id
|
|
7961
|
-
if self.update_mask is not None:
|
|
7962
|
-
body["update_mask"] = self.update_mask
|
|
7963
|
-
if self.visualization:
|
|
7964
|
-
body["visualization"] = self.visualization.as_dict()
|
|
7965
|
-
return body
|
|
7966
|
-
|
|
7967
|
-
def as_shallow_dict(self) -> dict:
|
|
7968
|
-
"""Serializes the UpdateVisualizationRequest into a shallow dictionary of its immediate attributes."""
|
|
7969
|
-
body = {}
|
|
7970
|
-
if self.id is not None:
|
|
7971
|
-
body["id"] = self.id
|
|
7972
|
-
if self.update_mask is not None:
|
|
7973
|
-
body["update_mask"] = self.update_mask
|
|
7974
|
-
if self.visualization:
|
|
7975
|
-
body["visualization"] = self.visualization
|
|
7976
|
-
return body
|
|
7977
|
-
|
|
7978
|
-
@classmethod
|
|
7979
|
-
def from_dict(cls, d: Dict[str, Any]) -> UpdateVisualizationRequest:
|
|
7980
|
-
"""Deserializes the UpdateVisualizationRequest from a dictionary."""
|
|
7981
|
-
return cls(
|
|
7982
|
-
id=d.get("id", None),
|
|
7983
|
-
update_mask=d.get("update_mask", None),
|
|
7984
|
-
visualization=_from_dict(d, "visualization", UpdateVisualizationRequestVisualization),
|
|
7985
|
-
)
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
6519
|
@dataclass
|
|
7989
6520
|
class UpdateVisualizationRequestVisualization:
|
|
7990
6521
|
display_name: Optional[str] = None
|
|
@@ -8165,7 +6696,6 @@ class WarehouseAccessControlRequest:
|
|
|
8165
6696
|
"""name of the group"""
|
|
8166
6697
|
|
|
8167
6698
|
permission_level: Optional[WarehousePermissionLevel] = None
|
|
8168
|
-
"""Permission level"""
|
|
8169
6699
|
|
|
8170
6700
|
service_principal_name: Optional[str] = None
|
|
8171
6701
|
"""application ID of a service principal"""
|
|
@@ -8276,7 +6806,6 @@ class WarehousePermission:
|
|
|
8276
6806
|
inherited_from_object: Optional[List[str]] = None
|
|
8277
6807
|
|
|
8278
6808
|
permission_level: Optional[WarehousePermissionLevel] = None
|
|
8279
|
-
"""Permission level"""
|
|
8280
6809
|
|
|
8281
6810
|
def as_dict(self) -> dict:
|
|
8282
6811
|
"""Serializes the WarehousePermission into a dictionary suitable for use as a JSON request body."""
|
|
@@ -8365,7 +6894,6 @@ class WarehousePermissionsDescription:
|
|
|
8365
6894
|
description: Optional[str] = None
|
|
8366
6895
|
|
|
8367
6896
|
permission_level: Optional[WarehousePermissionLevel] = None
|
|
8368
|
-
"""Permission level"""
|
|
8369
6897
|
|
|
8370
6898
|
def as_dict(self) -> dict:
|
|
8371
6899
|
"""Serializes the WarehousePermissionsDescription into a dictionary suitable for use as a JSON request body."""
|
|
@@ -8394,40 +6922,6 @@ class WarehousePermissionsDescription:
|
|
|
8394
6922
|
)
|
|
8395
6923
|
|
|
8396
6924
|
|
|
8397
|
-
@dataclass
|
|
8398
|
-
class WarehousePermissionsRequest:
|
|
8399
|
-
access_control_list: Optional[List[WarehouseAccessControlRequest]] = None
|
|
8400
|
-
|
|
8401
|
-
warehouse_id: Optional[str] = None
|
|
8402
|
-
"""The SQL warehouse for which to get or manage permissions."""
|
|
8403
|
-
|
|
8404
|
-
def as_dict(self) -> dict:
|
|
8405
|
-
"""Serializes the WarehousePermissionsRequest into a dictionary suitable for use as a JSON request body."""
|
|
8406
|
-
body = {}
|
|
8407
|
-
if self.access_control_list:
|
|
8408
|
-
body["access_control_list"] = [v.as_dict() for v in self.access_control_list]
|
|
8409
|
-
if self.warehouse_id is not None:
|
|
8410
|
-
body["warehouse_id"] = self.warehouse_id
|
|
8411
|
-
return body
|
|
8412
|
-
|
|
8413
|
-
def as_shallow_dict(self) -> dict:
|
|
8414
|
-
"""Serializes the WarehousePermissionsRequest into a shallow dictionary of its immediate attributes."""
|
|
8415
|
-
body = {}
|
|
8416
|
-
if self.access_control_list:
|
|
8417
|
-
body["access_control_list"] = self.access_control_list
|
|
8418
|
-
if self.warehouse_id is not None:
|
|
8419
|
-
body["warehouse_id"] = self.warehouse_id
|
|
8420
|
-
return body
|
|
8421
|
-
|
|
8422
|
-
@classmethod
|
|
8423
|
-
def from_dict(cls, d: Dict[str, Any]) -> WarehousePermissionsRequest:
|
|
8424
|
-
"""Deserializes the WarehousePermissionsRequest from a dictionary."""
|
|
8425
|
-
return cls(
|
|
8426
|
-
access_control_list=_repeated_dict(d, "access_control_list", WarehouseAccessControlRequest),
|
|
8427
|
-
warehouse_id=d.get("warehouse_id", None),
|
|
8428
|
-
)
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
6925
|
@dataclass
|
|
8432
6926
|
class WarehouseTypePair:
|
|
8433
6927
|
enabled: Optional[bool] = None
|
|
@@ -8914,6 +7408,7 @@ class AlertsLegacyAPI:
|
|
|
8914
7408
|
|
|
8915
7409
|
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
|
|
8916
7410
|
|
|
7411
|
+
|
|
8917
7412
|
:returns: Iterator over :class:`LegacyAlert`
|
|
8918
7413
|
"""
|
|
8919
7414
|
|
|
@@ -9090,7 +7585,7 @@ class DashboardWidgetsAPI:
|
|
|
9090
7585
|
text: Optional[str] = None,
|
|
9091
7586
|
visualization_id: Optional[str] = None,
|
|
9092
7587
|
) -> Widget:
|
|
9093
|
-
"""
|
|
7588
|
+
"""Adds a widget to a dashboard
|
|
9094
7589
|
|
|
9095
7590
|
:param dashboard_id: str
|
|
9096
7591
|
Dashboard ID returned by :method:dashboards/create.
|
|
@@ -9125,7 +7620,7 @@ class DashboardWidgetsAPI:
|
|
|
9125
7620
|
return Widget.from_dict(res)
|
|
9126
7621
|
|
|
9127
7622
|
def delete(self, id: str):
|
|
9128
|
-
"""
|
|
7623
|
+
"""Removes a widget from a dashboard
|
|
9129
7624
|
|
|
9130
7625
|
:param id: str
|
|
9131
7626
|
Widget ID returned by :method:dashboardwidgets/create
|
|
@@ -9149,7 +7644,7 @@ class DashboardWidgetsAPI:
|
|
|
9149
7644
|
text: Optional[str] = None,
|
|
9150
7645
|
visualization_id: Optional[str] = None,
|
|
9151
7646
|
) -> Widget:
|
|
9152
|
-
"""
|
|
7647
|
+
"""Updates an existing widget
|
|
9153
7648
|
|
|
9154
7649
|
:param id: str
|
|
9155
7650
|
Widget ID returned by :method:dashboardwidgets/create
|
|
@@ -9196,54 +7691,6 @@ class DashboardsAPI:
|
|
|
9196
7691
|
def __init__(self, api_client):
|
|
9197
7692
|
self._api = api_client
|
|
9198
7693
|
|
|
9199
|
-
def create(
|
|
9200
|
-
self,
|
|
9201
|
-
name: str,
|
|
9202
|
-
*,
|
|
9203
|
-
dashboard_filters_enabled: Optional[bool] = None,
|
|
9204
|
-
is_favorite: Optional[bool] = None,
|
|
9205
|
-
parent: Optional[str] = None,
|
|
9206
|
-
run_as_role: Optional[RunAsRole] = None,
|
|
9207
|
-
tags: Optional[List[str]] = None,
|
|
9208
|
-
) -> Dashboard:
|
|
9209
|
-
"""Create a dashboard object.
|
|
9210
|
-
|
|
9211
|
-
:param name: str
|
|
9212
|
-
The title of this dashboard that appears in list views and at the top of the dashboard page.
|
|
9213
|
-
:param dashboard_filters_enabled: bool (optional)
|
|
9214
|
-
Indicates whether the dashboard filters are enabled
|
|
9215
|
-
:param is_favorite: bool (optional)
|
|
9216
|
-
Indicates whether this dashboard object should appear in the current user's favorites list.
|
|
9217
|
-
:param parent: str (optional)
|
|
9218
|
-
The identifier of the workspace folder containing the object.
|
|
9219
|
-
:param run_as_role: :class:`RunAsRole` (optional)
|
|
9220
|
-
Sets the **Run as** role for the object. Must be set to one of `"viewer"` (signifying "run as
|
|
9221
|
-
viewer" behavior) or `"owner"` (signifying "run as owner" behavior)
|
|
9222
|
-
:param tags: List[str] (optional)
|
|
9223
|
-
|
|
9224
|
-
:returns: :class:`Dashboard`
|
|
9225
|
-
"""
|
|
9226
|
-
body = {}
|
|
9227
|
-
if dashboard_filters_enabled is not None:
|
|
9228
|
-
body["dashboard_filters_enabled"] = dashboard_filters_enabled
|
|
9229
|
-
if is_favorite is not None:
|
|
9230
|
-
body["is_favorite"] = is_favorite
|
|
9231
|
-
if name is not None:
|
|
9232
|
-
body["name"] = name
|
|
9233
|
-
if parent is not None:
|
|
9234
|
-
body["parent"] = parent
|
|
9235
|
-
if run_as_role is not None:
|
|
9236
|
-
body["run_as_role"] = run_as_role.value
|
|
9237
|
-
if tags is not None:
|
|
9238
|
-
body["tags"] = [v for v in tags]
|
|
9239
|
-
headers = {
|
|
9240
|
-
"Accept": "application/json",
|
|
9241
|
-
"Content-Type": "application/json",
|
|
9242
|
-
}
|
|
9243
|
-
|
|
9244
|
-
res = self._api.do("POST", "/api/2.0/preview/sql/dashboards", body=body, headers=headers)
|
|
9245
|
-
return Dashboard.from_dict(res)
|
|
9246
|
-
|
|
9247
7694
|
def delete(self, dashboard_id: str):
|
|
9248
7695
|
"""Moves a dashboard to the trash. Trashed dashboards do not appear in list views or searches, and cannot
|
|
9249
7696
|
be shared.
|
|
@@ -9312,17 +7759,11 @@ class DashboardsAPI:
|
|
|
9312
7759
|
"Accept": "application/json",
|
|
9313
7760
|
}
|
|
9314
7761
|
|
|
9315
|
-
# deduplicate items that may have been added during iteration
|
|
9316
|
-
seen = set()
|
|
9317
7762
|
query["page"] = 1
|
|
9318
7763
|
while True:
|
|
9319
7764
|
json = self._api.do("GET", "/api/2.0/preview/sql/dashboards", query=query, headers=headers)
|
|
9320
7765
|
if "results" in json:
|
|
9321
7766
|
for v in json["results"]:
|
|
9322
|
-
i = v["id"]
|
|
9323
|
-
if i in seen:
|
|
9324
|
-
continue
|
|
9325
|
-
seen.add(i)
|
|
9326
7767
|
yield Dashboard.from_dict(v)
|
|
9327
7768
|
if "results" not in json or not json["results"]:
|
|
9328
7769
|
return
|
|
@@ -9407,6 +7848,7 @@ class DataSourcesAPI:
|
|
|
9407
7848
|
|
|
9408
7849
|
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
|
|
9409
7850
|
|
|
7851
|
+
|
|
9410
7852
|
:returns: Iterator over :class:`DataSource`
|
|
9411
7853
|
"""
|
|
9412
7854
|
|
|
@@ -9885,17 +8327,11 @@ class QueriesLegacyAPI:
|
|
|
9885
8327
|
"Accept": "application/json",
|
|
9886
8328
|
}
|
|
9887
8329
|
|
|
9888
|
-
# deduplicate items that may have been added during iteration
|
|
9889
|
-
seen = set()
|
|
9890
8330
|
query["page"] = 1
|
|
9891
8331
|
while True:
|
|
9892
8332
|
json = self._api.do("GET", "/api/2.0/preview/sql/queries", query=query, headers=headers)
|
|
9893
8333
|
if "results" in json:
|
|
9894
8334
|
for v in json["results"]:
|
|
9895
|
-
i = v["id"]
|
|
9896
|
-
if i in seen:
|
|
9897
|
-
continue
|
|
9898
|
-
seen.add(i)
|
|
9899
8335
|
yield LegacyQuery.from_dict(v)
|
|
9900
8336
|
if "results" not in json or not json["results"]:
|
|
9901
8337
|
return
|
|
@@ -10130,7 +8566,7 @@ class QueryVisualizationsLegacyAPI:
|
|
|
10130
8566
|
self._api = api_client
|
|
10131
8567
|
|
|
10132
8568
|
def create(
|
|
10133
|
-
self,
|
|
8569
|
+
self, options: Any, query_id: str, type: str, *, description: Optional[str] = None, name: Optional[str] = None
|
|
10134
8570
|
) -> LegacyVisualization:
|
|
10135
8571
|
"""Creates visualization in the query.
|
|
10136
8572
|
|
|
@@ -10139,13 +8575,13 @@ class QueryVisualizationsLegacyAPI:
|
|
|
10139
8575
|
|
|
10140
8576
|
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
|
|
10141
8577
|
|
|
8578
|
+
:param options: Any
|
|
8579
|
+
The options object varies widely from one visualization type to the next and is unsupported.
|
|
8580
|
+
Databricks does not recommend modifying visualization settings in JSON.
|
|
10142
8581
|
:param query_id: str
|
|
10143
8582
|
The identifier returned by :method:queries/create
|
|
10144
8583
|
:param type: str
|
|
10145
8584
|
The type of visualization: chart, table, pivot table, and so on.
|
|
10146
|
-
:param options: Any
|
|
10147
|
-
The options object varies widely from one visualization type to the next and is unsupported.
|
|
10148
|
-
Databricks does not recommend modifying visualization settings in JSON.
|
|
10149
8585
|
:param description: str (optional)
|
|
10150
8586
|
A short description of this visualization. This is not displayed in the UI.
|
|
10151
8587
|
:param name: str (optional)
|
|
@@ -10181,7 +8617,7 @@ class QueryVisualizationsLegacyAPI:
|
|
|
10181
8617
|
[Learn more]: https://docs.databricks.com/en/sql/dbsql-api-latest.html
|
|
10182
8618
|
|
|
10183
8619
|
:param id: str
|
|
10184
|
-
Widget ID returned by :method:
|
|
8620
|
+
Widget ID returned by :method:queryvisualizations/create
|
|
10185
8621
|
|
|
10186
8622
|
|
|
10187
8623
|
"""
|
|
@@ -10261,6 +8697,7 @@ class RedashConfigAPI:
|
|
|
10261
8697
|
def get_config(self) -> ClientConfig:
|
|
10262
8698
|
"""Read workspace configuration for Redash-v2.
|
|
10263
8699
|
|
|
8700
|
+
|
|
10264
8701
|
:returns: :class:`ClientConfig`
|
|
10265
8702
|
"""
|
|
10266
8703
|
|
|
@@ -10394,7 +8831,8 @@ class StatementExecutionAPI:
|
|
|
10394
8831
|
"""Execute a SQL statement
|
|
10395
8832
|
|
|
10396
8833
|
:param statement: str
|
|
10397
|
-
The SQL statement to execute. The statement can optionally be parameterized, see `parameters`.
|
|
8834
|
+
The SQL statement to execute. The statement can optionally be parameterized, see `parameters`. The
|
|
8835
|
+
maximum query text size is 16 MiB.
|
|
10398
8836
|
:param warehouse_id: str
|
|
10399
8837
|
Warehouse upon which to execute a statement. See also [What are SQL warehouses?]
|
|
10400
8838
|
|
|
@@ -10712,15 +9150,12 @@ class WarehousesAPI:
|
|
|
10712
9150
|
|
|
10713
9151
|
Supported values: - Must be unique within an org. - Must be less than 100 characters.
|
|
10714
9152
|
:param spot_instance_policy: :class:`SpotInstancePolicy` (optional)
|
|
10715
|
-
Configurations whether the warehouse should use spot instances.
|
|
10716
9153
|
:param tags: :class:`EndpointTags` (optional)
|
|
10717
9154
|
A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS volumes)
|
|
10718
9155
|
associated with this SQL warehouse.
|
|
10719
9156
|
|
|
10720
9157
|
Supported values: - Number of tags < 45.
|
|
10721
9158
|
:param warehouse_type: :class:`CreateWarehouseRequestWarehouseType` (optional)
|
|
10722
|
-
Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, you must set to `PRO` and
|
|
10723
|
-
also set the field `enable_serverless_compute` to `true`.
|
|
10724
9159
|
|
|
10725
9160
|
:returns:
|
|
10726
9161
|
Long-running operation waiter for :class:`GetWarehouseResponse`.
|
|
@@ -10881,15 +9316,12 @@ class WarehousesAPI:
|
|
|
10881
9316
|
|
|
10882
9317
|
Supported values: - Must be unique within an org. - Must be less than 100 characters.
|
|
10883
9318
|
:param spot_instance_policy: :class:`SpotInstancePolicy` (optional)
|
|
10884
|
-
Configurations whether the warehouse should use spot instances.
|
|
10885
9319
|
:param tags: :class:`EndpointTags` (optional)
|
|
10886
9320
|
A set of key-value pairs that will be tagged on all resources (e.g., AWS instances and EBS volumes)
|
|
10887
9321
|
associated with this SQL warehouse.
|
|
10888
9322
|
|
|
10889
9323
|
Supported values: - Number of tags < 45.
|
|
10890
9324
|
:param warehouse_type: :class:`EditWarehouseRequestWarehouseType` (optional)
|
|
10891
|
-
Warehouse type: `PRO` or `CLASSIC`. If you want to use serverless compute, you must set to `PRO` and
|
|
10892
|
-
also set the field `enable_serverless_compute` to `true`.
|
|
10893
9325
|
|
|
10894
9326
|
:returns:
|
|
10895
9327
|
Long-running operation waiter for :class:`GetWarehouseResponse`.
|
|
@@ -11018,6 +9450,7 @@ class WarehousesAPI:
|
|
|
11018
9450
|
def get_workspace_warehouse_config(self) -> GetWorkspaceWarehouseConfigResponse:
|
|
11019
9451
|
"""Gets the workspace level configuration that is shared by all SQL warehouses in a workspace.
|
|
11020
9452
|
|
|
9453
|
+
|
|
11021
9454
|
:returns: :class:`GetWorkspaceWarehouseConfigResponse`
|
|
11022
9455
|
"""
|
|
11023
9456
|
|