databricks-sdk 0.28.0__py3-none-any.whl → 0.30.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 +74 -22
- databricks/sdk/config.py +89 -48
- databricks/sdk/core.py +38 -9
- databricks/sdk/credentials_provider.py +134 -57
- databricks/sdk/data_plane.py +65 -0
- databricks/sdk/dbutils.py +81 -3
- databricks/sdk/mixins/files.py +12 -4
- databricks/sdk/oauth.py +8 -6
- databricks/sdk/service/apps.py +977 -0
- databricks/sdk/service/billing.py +602 -218
- databricks/sdk/service/catalog.py +263 -62
- databricks/sdk/service/compute.py +515 -94
- databricks/sdk/service/dashboards.py +1310 -2
- databricks/sdk/service/iam.py +99 -88
- databricks/sdk/service/jobs.py +159 -166
- databricks/sdk/service/marketplace.py +74 -58
- databricks/sdk/service/oauth2.py +149 -70
- databricks/sdk/service/pipelines.py +73 -53
- databricks/sdk/service/serving.py +332 -694
- databricks/sdk/service/settings.py +424 -4
- databricks/sdk/service/sharing.py +235 -26
- databricks/sdk/service/sql.py +2484 -553
- databricks/sdk/service/vectorsearch.py +75 -0
- databricks/sdk/useragent.py +144 -0
- databricks/sdk/version.py +1 -1
- {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/METADATA +37 -16
- {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/RECORD +31 -28
- {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/WHEEL +1 -1
- {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/LICENSE +0 -0
- {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/NOTICE +0 -0
- {databricks_sdk-0.28.0.dist-info → databricks_sdk-0.30.0.dist-info}/top_level.txt +0 -0
databricks/sdk/service/jobs.py
CHANGED
|
@@ -15,7 +15,7 @@ from ._internal import Wait, _enum, _from_dict, _repeated_dict
|
|
|
15
15
|
|
|
16
16
|
_LOG = logging.getLogger('databricks.sdk')
|
|
17
17
|
|
|
18
|
-
from databricks.sdk.service import compute
|
|
18
|
+
from databricks.sdk.service import compute
|
|
19
19
|
|
|
20
20
|
# all definitions in this file are in alphabetical order
|
|
21
21
|
|
|
@@ -469,7 +469,7 @@ class Continuous:
|
|
|
469
469
|
|
|
470
470
|
@dataclass
|
|
471
471
|
class CreateJob:
|
|
472
|
-
access_control_list: Optional[List[
|
|
472
|
+
access_control_list: Optional[List[JobAccessControlRequest]] = None
|
|
473
473
|
"""List of permissions to set on the job."""
|
|
474
474
|
|
|
475
475
|
continuous: Optional[Continuous] = None
|
|
@@ -480,7 +480,7 @@ class CreateJob:
|
|
|
480
480
|
"""Deployment information for jobs managed by external sources."""
|
|
481
481
|
|
|
482
482
|
description: Optional[str] = None
|
|
483
|
-
"""An optional description for the job. The maximum length is
|
|
483
|
+
"""An optional description for the job. The maximum length is 27700 characters in UTF-8 encoding."""
|
|
484
484
|
|
|
485
485
|
edit_mode: Optional[JobEditMode] = None
|
|
486
486
|
"""Edit mode of the job.
|
|
@@ -603,7 +603,7 @@ class CreateJob:
|
|
|
603
603
|
@classmethod
|
|
604
604
|
def from_dict(cls, d: Dict[str, any]) -> CreateJob:
|
|
605
605
|
"""Deserializes the CreateJob from a dictionary."""
|
|
606
|
-
return cls(access_control_list=_repeated_dict(d, 'access_control_list',
|
|
606
|
+
return cls(access_control_list=_repeated_dict(d, 'access_control_list', JobAccessControlRequest),
|
|
607
607
|
continuous=_from_dict(d, 'continuous', Continuous),
|
|
608
608
|
deployment=_from_dict(d, 'deployment', JobDeployment),
|
|
609
609
|
description=d.get('description', None),
|
|
@@ -940,17 +940,23 @@ class ForEachTaskErrorMessageStats:
|
|
|
940
940
|
error_message: Optional[str] = None
|
|
941
941
|
"""Describes the error message occured during the iterations."""
|
|
942
942
|
|
|
943
|
+
termination_category: Optional[str] = None
|
|
944
|
+
"""Describes the termination reason for the error message."""
|
|
945
|
+
|
|
943
946
|
def as_dict(self) -> dict:
|
|
944
947
|
"""Serializes the ForEachTaskErrorMessageStats into a dictionary suitable for use as a JSON request body."""
|
|
945
948
|
body = {}
|
|
946
949
|
if self.count is not None: body['count'] = self.count
|
|
947
950
|
if self.error_message is not None: body['error_message'] = self.error_message
|
|
951
|
+
if self.termination_category is not None: body['termination_category'] = self.termination_category
|
|
948
952
|
return body
|
|
949
953
|
|
|
950
954
|
@classmethod
|
|
951
955
|
def from_dict(cls, d: Dict[str, any]) -> ForEachTaskErrorMessageStats:
|
|
952
956
|
"""Deserializes the ForEachTaskErrorMessageStats from a dictionary."""
|
|
953
|
-
return cls(count=d.get('count', None),
|
|
957
|
+
return cls(count=d.get('count', None),
|
|
958
|
+
error_message=d.get('error_message', None),
|
|
959
|
+
termination_category=d.get('termination_category', None))
|
|
954
960
|
|
|
955
961
|
|
|
956
962
|
@dataclass
|
|
@@ -1315,6 +1321,13 @@ class JobEmailNotifications:
|
|
|
1315
1321
|
"""A list of email addresses to be notified when a run begins. If not specified on job creation,
|
|
1316
1322
|
reset, or update, the list is empty, and notifications are not sent."""
|
|
1317
1323
|
|
|
1324
|
+
on_streaming_backlog_exceeded: Optional[List[str]] = None
|
|
1325
|
+
"""A list of email addresses to notify when any streaming backlog thresholds are exceeded for any
|
|
1326
|
+
stream. Streaming backlog thresholds can be set in the `health` field using the following
|
|
1327
|
+
metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`, or
|
|
1328
|
+
`STREAMING_BACKLOG_FILES`. Alerting is based on the 10-minute average of these metrics. If the
|
|
1329
|
+
issue persists, notifications are resent every 30 minutes."""
|
|
1330
|
+
|
|
1318
1331
|
on_success: Optional[List[str]] = None
|
|
1319
1332
|
"""A list of email addresses to be notified when a run successfully completes. A run is considered
|
|
1320
1333
|
to have completed successfully if it ends with a `TERMINATED` `life_cycle_state` and a `SUCCESS`
|
|
@@ -1332,6 +1345,8 @@ class JobEmailNotifications:
|
|
|
1332
1345
|
]
|
|
1333
1346
|
if self.on_failure: body['on_failure'] = [v for v in self.on_failure]
|
|
1334
1347
|
if self.on_start: body['on_start'] = [v for v in self.on_start]
|
|
1348
|
+
if self.on_streaming_backlog_exceeded:
|
|
1349
|
+
body['on_streaming_backlog_exceeded'] = [v for v in self.on_streaming_backlog_exceeded]
|
|
1335
1350
|
if self.on_success: body['on_success'] = [v for v in self.on_success]
|
|
1336
1351
|
return body
|
|
1337
1352
|
|
|
@@ -1343,6 +1358,7 @@ class JobEmailNotifications:
|
|
|
1343
1358
|
None),
|
|
1344
1359
|
on_failure=d.get('on_failure', None),
|
|
1345
1360
|
on_start=d.get('on_start', None),
|
|
1361
|
+
on_streaming_backlog_exceeded=d.get('on_streaming_backlog_exceeded', None),
|
|
1346
1362
|
on_success=d.get('on_success', None))
|
|
1347
1363
|
|
|
1348
1364
|
|
|
@@ -1352,9 +1368,8 @@ class JobEnvironment:
|
|
|
1352
1368
|
"""The key of an environment. It has to be unique within a job."""
|
|
1353
1369
|
|
|
1354
1370
|
spec: Optional[compute.Environment] = None
|
|
1355
|
-
"""The
|
|
1356
|
-
|
|
1357
|
-
supported. Next ID: 5"""
|
|
1371
|
+
"""The environment entity used to preserve serverless environment side panel and jobs' environment
|
|
1372
|
+
for non-notebook task. In this minimal environment spec, only pip dependencies are supported."""
|
|
1358
1373
|
|
|
1359
1374
|
def as_dict(self) -> dict:
|
|
1360
1375
|
"""Serializes the JobEnvironment into a dictionary suitable for use as a JSON request body."""
|
|
@@ -1586,7 +1601,7 @@ class JobSettings:
|
|
|
1586
1601
|
"""Deployment information for jobs managed by external sources."""
|
|
1587
1602
|
|
|
1588
1603
|
description: Optional[str] = None
|
|
1589
|
-
"""An optional description for the job. The maximum length is
|
|
1604
|
+
"""An optional description for the job. The maximum length is 27700 characters in UTF-8 encoding."""
|
|
1590
1605
|
|
|
1591
1606
|
edit_mode: Optional[JobEditMode] = None
|
|
1592
1607
|
"""Edit mode of the job.
|
|
@@ -1783,9 +1798,21 @@ class JobSourceDirtyState(Enum):
|
|
|
1783
1798
|
|
|
1784
1799
|
|
|
1785
1800
|
class JobsHealthMetric(Enum):
|
|
1786
|
-
"""Specifies the health metric that is being evaluated for a particular health rule.
|
|
1801
|
+
"""Specifies the health metric that is being evaluated for a particular health rule.
|
|
1802
|
+
|
|
1803
|
+
* `RUN_DURATION_SECONDS`: Expected total time for a run in seconds. * `STREAMING_BACKLOG_BYTES`:
|
|
1804
|
+
An estimate of the maximum bytes of data waiting to be consumed across all streams. This metric
|
|
1805
|
+
is in Private Preview. * `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset lag
|
|
1806
|
+
across all streams. This metric is in Private Preview. * `STREAMING_BACKLOG_SECONDS`: An
|
|
1807
|
+
estimate of the maximum consumer delay across all streams. This metric is in Private Preview. *
|
|
1808
|
+
`STREAMING_BACKLOG_FILES`: An estimate of the maximum number of outstanding files across all
|
|
1809
|
+
streams. This metric is in Private Preview."""
|
|
1787
1810
|
|
|
1788
1811
|
RUN_DURATION_SECONDS = 'RUN_DURATION_SECONDS'
|
|
1812
|
+
STREAMING_BACKLOG_BYTES = 'STREAMING_BACKLOG_BYTES'
|
|
1813
|
+
STREAMING_BACKLOG_FILES = 'STREAMING_BACKLOG_FILES'
|
|
1814
|
+
STREAMING_BACKLOG_RECORDS = 'STREAMING_BACKLOG_RECORDS'
|
|
1815
|
+
STREAMING_BACKLOG_SECONDS = 'STREAMING_BACKLOG_SECONDS'
|
|
1789
1816
|
|
|
1790
1817
|
|
|
1791
1818
|
class JobsHealthOperator(Enum):
|
|
@@ -1797,7 +1824,15 @@ class JobsHealthOperator(Enum):
|
|
|
1797
1824
|
@dataclass
|
|
1798
1825
|
class JobsHealthRule:
|
|
1799
1826
|
metric: JobsHealthMetric
|
|
1800
|
-
"""Specifies the health metric that is being evaluated for a particular health rule.
|
|
1827
|
+
"""Specifies the health metric that is being evaluated for a particular health rule.
|
|
1828
|
+
|
|
1829
|
+
* `RUN_DURATION_SECONDS`: Expected total time for a run in seconds. * `STREAMING_BACKLOG_BYTES`:
|
|
1830
|
+
An estimate of the maximum bytes of data waiting to be consumed across all streams. This metric
|
|
1831
|
+
is in Private Preview. * `STREAMING_BACKLOG_RECORDS`: An estimate of the maximum offset lag
|
|
1832
|
+
across all streams. This metric is in Private Preview. * `STREAMING_BACKLOG_SECONDS`: An
|
|
1833
|
+
estimate of the maximum consumer delay across all streams. This metric is in Private Preview. *
|
|
1834
|
+
`STREAMING_BACKLOG_FILES`: An estimate of the maximum number of outstanding files across all
|
|
1835
|
+
streams. This metric is in Private Preview."""
|
|
1801
1836
|
|
|
1802
1837
|
op: JobsHealthOperator
|
|
1803
1838
|
"""Specifies the operator used to compare the health metric value with the specified threshold."""
|
|
@@ -1994,6 +2029,35 @@ class PauseStatus(Enum):
|
|
|
1994
2029
|
UNPAUSED = 'UNPAUSED'
|
|
1995
2030
|
|
|
1996
2031
|
|
|
2032
|
+
@dataclass
|
|
2033
|
+
class PeriodicTriggerConfiguration:
|
|
2034
|
+
interval: int
|
|
2035
|
+
"""The interval at which the trigger should run."""
|
|
2036
|
+
|
|
2037
|
+
unit: PeriodicTriggerConfigurationTimeUnit
|
|
2038
|
+
"""The unit of time for the interval."""
|
|
2039
|
+
|
|
2040
|
+
def as_dict(self) -> dict:
|
|
2041
|
+
"""Serializes the PeriodicTriggerConfiguration into a dictionary suitable for use as a JSON request body."""
|
|
2042
|
+
body = {}
|
|
2043
|
+
if self.interval is not None: body['interval'] = self.interval
|
|
2044
|
+
if self.unit is not None: body['unit'] = self.unit.value
|
|
2045
|
+
return body
|
|
2046
|
+
|
|
2047
|
+
@classmethod
|
|
2048
|
+
def from_dict(cls, d: Dict[str, any]) -> PeriodicTriggerConfiguration:
|
|
2049
|
+
"""Deserializes the PeriodicTriggerConfiguration from a dictionary."""
|
|
2050
|
+
return cls(interval=d.get('interval', None),
|
|
2051
|
+
unit=_enum(d, 'unit', PeriodicTriggerConfigurationTimeUnit))
|
|
2052
|
+
|
|
2053
|
+
|
|
2054
|
+
class PeriodicTriggerConfigurationTimeUnit(Enum):
|
|
2055
|
+
|
|
2056
|
+
DAYS = 'DAYS'
|
|
2057
|
+
HOURS = 'HOURS'
|
|
2058
|
+
WEEKS = 'WEEKS'
|
|
2059
|
+
|
|
2060
|
+
|
|
1997
2061
|
@dataclass
|
|
1998
2062
|
class PipelineParams:
|
|
1999
2063
|
full_refresh: Optional[bool] = None
|
|
@@ -2448,7 +2512,6 @@ class ResolvedStringParamsValues:
|
|
|
2448
2512
|
|
|
2449
2513
|
@dataclass
|
|
2450
2514
|
class ResolvedValues:
|
|
2451
|
-
|
|
2452
2515
|
condition_task: Optional[ResolvedConditionTaskValues] = None
|
|
2453
2516
|
|
|
2454
2517
|
dbt_task: Optional[ResolvedDbtTaskValues] = None
|
|
@@ -2551,6 +2614,9 @@ class Run:
|
|
|
2551
2614
|
Note: dbt and SQL File tasks support only version-controlled sources. If dbt or SQL File tasks
|
|
2552
2615
|
are used, `git_source` must be defined on the job."""
|
|
2553
2616
|
|
|
2617
|
+
iterations: Optional[List[RunTask]] = None
|
|
2618
|
+
"""Only populated by for-each iterations. The parent for-each task is located in tasks array."""
|
|
2619
|
+
|
|
2554
2620
|
job_clusters: Optional[List[JobCluster]] = None
|
|
2555
2621
|
"""A list of job cluster specifications that can be shared and reused by tasks of this job.
|
|
2556
2622
|
Libraries cannot be declared in a shared job cluster. You must declare dependent libraries in
|
|
@@ -2562,6 +2628,9 @@ class Run:
|
|
|
2562
2628
|
job_parameters: Optional[List[JobParameter]] = None
|
|
2563
2629
|
"""Job-level parameters used in the run"""
|
|
2564
2630
|
|
|
2631
|
+
next_page_token: Optional[str] = None
|
|
2632
|
+
"""A token that can be used to list the next page of sub-resources."""
|
|
2633
|
+
|
|
2565
2634
|
number_in_job: Optional[int] = None
|
|
2566
2635
|
"""A unique identifier for this job run. This is set to the same value as `run_id`."""
|
|
2567
2636
|
|
|
@@ -2572,6 +2641,9 @@ class Run:
|
|
|
2572
2641
|
overriding_parameters: Optional[RunParameters] = None
|
|
2573
2642
|
"""The parameters used for this run."""
|
|
2574
2643
|
|
|
2644
|
+
prev_page_token: Optional[str] = None
|
|
2645
|
+
"""A token that can be used to list the previous page of sub-resources."""
|
|
2646
|
+
|
|
2575
2647
|
queue_duration: Optional[int] = None
|
|
2576
2648
|
"""The time in milliseconds that the run has spent in the queue."""
|
|
2577
2649
|
|
|
@@ -2645,13 +2717,16 @@ class Run:
|
|
|
2645
2717
|
if self.end_time is not None: body['end_time'] = self.end_time
|
|
2646
2718
|
if self.execution_duration is not None: body['execution_duration'] = self.execution_duration
|
|
2647
2719
|
if self.git_source: body['git_source'] = self.git_source.as_dict()
|
|
2720
|
+
if self.iterations: body['iterations'] = [v.as_dict() for v in self.iterations]
|
|
2648
2721
|
if self.job_clusters: body['job_clusters'] = [v.as_dict() for v in self.job_clusters]
|
|
2649
2722
|
if self.job_id is not None: body['job_id'] = self.job_id
|
|
2650
2723
|
if self.job_parameters: body['job_parameters'] = [v.as_dict() for v in self.job_parameters]
|
|
2724
|
+
if self.next_page_token is not None: body['next_page_token'] = self.next_page_token
|
|
2651
2725
|
if self.number_in_job is not None: body['number_in_job'] = self.number_in_job
|
|
2652
2726
|
if self.original_attempt_run_id is not None:
|
|
2653
2727
|
body['original_attempt_run_id'] = self.original_attempt_run_id
|
|
2654
2728
|
if self.overriding_parameters: body['overriding_parameters'] = self.overriding_parameters.as_dict()
|
|
2729
|
+
if self.prev_page_token is not None: body['prev_page_token'] = self.prev_page_token
|
|
2655
2730
|
if self.queue_duration is not None: body['queue_duration'] = self.queue_duration
|
|
2656
2731
|
if self.repair_history: body['repair_history'] = [v.as_dict() for v in self.repair_history]
|
|
2657
2732
|
if self.run_duration is not None: body['run_duration'] = self.run_duration
|
|
@@ -2680,12 +2755,15 @@ class Run:
|
|
|
2680
2755
|
end_time=d.get('end_time', None),
|
|
2681
2756
|
execution_duration=d.get('execution_duration', None),
|
|
2682
2757
|
git_source=_from_dict(d, 'git_source', GitSource),
|
|
2758
|
+
iterations=_repeated_dict(d, 'iterations', RunTask),
|
|
2683
2759
|
job_clusters=_repeated_dict(d, 'job_clusters', JobCluster),
|
|
2684
2760
|
job_id=d.get('job_id', None),
|
|
2685
2761
|
job_parameters=_repeated_dict(d, 'job_parameters', JobParameter),
|
|
2762
|
+
next_page_token=d.get('next_page_token', None),
|
|
2686
2763
|
number_in_job=d.get('number_in_job', None),
|
|
2687
2764
|
original_attempt_run_id=d.get('original_attempt_run_id', None),
|
|
2688
2765
|
overriding_parameters=_from_dict(d, 'overriding_parameters', RunParameters),
|
|
2766
|
+
prev_page_token=d.get('prev_page_token', None),
|
|
2689
2767
|
queue_duration=d.get('queue_duration', None),
|
|
2690
2768
|
repair_history=_repeated_dict(d, 'repair_history', RepairHistoryItem),
|
|
2691
2769
|
run_duration=d.get('run_duration', None),
|
|
@@ -3391,6 +3469,10 @@ class RunTask:
|
|
|
3391
3469
|
"""The time at which this run ended in epoch milliseconds (milliseconds since 1/1/1970 UTC). This
|
|
3392
3470
|
field is set to 0 if the job is still running."""
|
|
3393
3471
|
|
|
3472
|
+
environment_key: Optional[str] = None
|
|
3473
|
+
"""The key that references an environment spec in a job. This field is required for Python script,
|
|
3474
|
+
Python wheel and dbt tasks when using serverless compute."""
|
|
3475
|
+
|
|
3394
3476
|
execution_duration: Optional[int] = None
|
|
3395
3477
|
"""The time in milliseconds it took to execute the commands in the JAR or notebook until they
|
|
3396
3478
|
completed, failed, timed out, were cancelled, or encountered an unexpected error. The duration
|
|
@@ -3522,6 +3604,7 @@ class RunTask:
|
|
|
3522
3604
|
if self.description is not None: body['description'] = self.description
|
|
3523
3605
|
if self.email_notifications: body['email_notifications'] = self.email_notifications.as_dict()
|
|
3524
3606
|
if self.end_time is not None: body['end_time'] = self.end_time
|
|
3607
|
+
if self.environment_key is not None: body['environment_key'] = self.environment_key
|
|
3525
3608
|
if self.execution_duration is not None: body['execution_duration'] = self.execution_duration
|
|
3526
3609
|
if self.existing_cluster_id is not None: body['existing_cluster_id'] = self.existing_cluster_id
|
|
3527
3610
|
if self.for_each_task: body['for_each_task'] = self.for_each_task.as_dict()
|
|
@@ -3564,6 +3647,7 @@ class RunTask:
|
|
|
3564
3647
|
description=d.get('description', None),
|
|
3565
3648
|
email_notifications=_from_dict(d, 'email_notifications', JobEmailNotifications),
|
|
3566
3649
|
end_time=d.get('end_time', None),
|
|
3650
|
+
environment_key=d.get('environment_key', None),
|
|
3567
3651
|
execution_duration=d.get('execution_duration', None),
|
|
3568
3652
|
existing_cluster_id=d.get('existing_cluster_id', None),
|
|
3569
3653
|
for_each_task=_from_dict(d, 'for_each_task', RunForEachTask),
|
|
@@ -4118,21 +4202,15 @@ class SqlTaskSubscription:
|
|
|
4118
4202
|
|
|
4119
4203
|
@dataclass
|
|
4120
4204
|
class SubmitRun:
|
|
4121
|
-
access_control_list: Optional[List[
|
|
4205
|
+
access_control_list: Optional[List[JobAccessControlRequest]] = None
|
|
4122
4206
|
"""List of permissions to set on the job."""
|
|
4123
4207
|
|
|
4124
|
-
condition_task: Optional[ConditionTask] = None
|
|
4125
|
-
"""If condition_task, specifies a condition with an outcome that can be used to control the
|
|
4126
|
-
execution of other tasks. Does not require a cluster to execute and does not support retries or
|
|
4127
|
-
notifications."""
|
|
4128
|
-
|
|
4129
|
-
dbt_task: Optional[DbtTask] = None
|
|
4130
|
-
"""If dbt_task, indicates that this must execute a dbt task. It requires both Databricks SQL and
|
|
4131
|
-
the ability to use a serverless or a pro SQL warehouse."""
|
|
4132
|
-
|
|
4133
4208
|
email_notifications: Optional[JobEmailNotifications] = None
|
|
4134
4209
|
"""An optional set of email addresses notified when the run begins or completes."""
|
|
4135
4210
|
|
|
4211
|
+
environments: Optional[List[JobEnvironment]] = None
|
|
4212
|
+
"""A list of task execution environment specifications that can be referenced by tasks of this run."""
|
|
4213
|
+
|
|
4136
4214
|
git_source: Optional[GitSource] = None
|
|
4137
4215
|
"""An optional specification for a remote Git repository containing the source code used by tasks.
|
|
4138
4216
|
Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.
|
|
@@ -4160,20 +4238,10 @@ class SubmitRun:
|
|
|
4160
4238
|
|
|
4161
4239
|
[How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html"""
|
|
4162
4240
|
|
|
4163
|
-
notebook_task: Optional[NotebookTask] = None
|
|
4164
|
-
"""If notebook_task, indicates that this task must run a notebook. This field may not be specified
|
|
4165
|
-
in conjunction with spark_jar_task."""
|
|
4166
|
-
|
|
4167
4241
|
notification_settings: Optional[JobNotificationSettings] = None
|
|
4168
4242
|
"""Optional notification settings that are used when sending notifications to each of the
|
|
4169
4243
|
`email_notifications` and `webhook_notifications` for this run."""
|
|
4170
4244
|
|
|
4171
|
-
pipeline_task: Optional[PipelineTask] = None
|
|
4172
|
-
"""If pipeline_task, indicates that this task must execute a Pipeline."""
|
|
4173
|
-
|
|
4174
|
-
python_wheel_task: Optional[PythonWheelTask] = None
|
|
4175
|
-
"""If python_wheel_task, indicates that this job must execute a PythonWheel."""
|
|
4176
|
-
|
|
4177
4245
|
queue: Optional[QueueSettings] = None
|
|
4178
4246
|
"""The queue settings of the one-time run."""
|
|
4179
4247
|
|
|
@@ -4181,38 +4249,9 @@ class SubmitRun:
|
|
|
4181
4249
|
"""Specifies the user or service principal that the job runs as. If not specified, the job runs as
|
|
4182
4250
|
the user who submits the request."""
|
|
4183
4251
|
|
|
4184
|
-
run_job_task: Optional[RunJobTask] = None
|
|
4185
|
-
"""If run_job_task, indicates that this task must execute another job."""
|
|
4186
|
-
|
|
4187
4252
|
run_name: Optional[str] = None
|
|
4188
4253
|
"""An optional name for the run. The default value is `Untitled`."""
|
|
4189
4254
|
|
|
4190
|
-
spark_jar_task: Optional[SparkJarTask] = None
|
|
4191
|
-
"""If spark_jar_task, indicates that this task must run a JAR."""
|
|
4192
|
-
|
|
4193
|
-
spark_python_task: Optional[SparkPythonTask] = None
|
|
4194
|
-
"""If spark_python_task, indicates that this task must run a Python file."""
|
|
4195
|
-
|
|
4196
|
-
spark_submit_task: Optional[SparkSubmitTask] = None
|
|
4197
|
-
"""If `spark_submit_task`, indicates that this task must be launched by the spark submit script.
|
|
4198
|
-
This task can run only on new clusters.
|
|
4199
|
-
|
|
4200
|
-
In the `new_cluster` specification, `libraries` and `spark_conf` are not supported. Instead, use
|
|
4201
|
-
`--jars` and `--py-files` to add Java and Python libraries and `--conf` to set the Spark
|
|
4202
|
-
configurations.
|
|
4203
|
-
|
|
4204
|
-
`master`, `deploy-mode`, and `executor-cores` are automatically configured by Databricks; you
|
|
4205
|
-
_cannot_ specify them in parameters.
|
|
4206
|
-
|
|
4207
|
-
By default, the Spark submit job uses all available memory (excluding reserved memory for
|
|
4208
|
-
Databricks services). You can set `--driver-memory`, and `--executor-memory` to a smaller value
|
|
4209
|
-
to leave some room for off-heap usage.
|
|
4210
|
-
|
|
4211
|
-
The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 paths."""
|
|
4212
|
-
|
|
4213
|
-
sql_task: Optional[SqlTask] = None
|
|
4214
|
-
"""If sql_task, indicates that this job must execute a SQL task."""
|
|
4215
|
-
|
|
4216
4255
|
tasks: Optional[List[SubmitTask]] = None
|
|
4217
4256
|
|
|
4218
4257
|
timeout_seconds: Optional[int] = None
|
|
@@ -4226,24 +4265,15 @@ class SubmitRun:
|
|
|
4226
4265
|
body = {}
|
|
4227
4266
|
if self.access_control_list:
|
|
4228
4267
|
body['access_control_list'] = [v.as_dict() for v in self.access_control_list]
|
|
4229
|
-
if self.condition_task: body['condition_task'] = self.condition_task.as_dict()
|
|
4230
|
-
if self.dbt_task: body['dbt_task'] = self.dbt_task.as_dict()
|
|
4231
4268
|
if self.email_notifications: body['email_notifications'] = self.email_notifications.as_dict()
|
|
4269
|
+
if self.environments: body['environments'] = [v.as_dict() for v in self.environments]
|
|
4232
4270
|
if self.git_source: body['git_source'] = self.git_source.as_dict()
|
|
4233
4271
|
if self.health: body['health'] = self.health.as_dict()
|
|
4234
4272
|
if self.idempotency_token is not None: body['idempotency_token'] = self.idempotency_token
|
|
4235
|
-
if self.notebook_task: body['notebook_task'] = self.notebook_task.as_dict()
|
|
4236
4273
|
if self.notification_settings: body['notification_settings'] = self.notification_settings.as_dict()
|
|
4237
|
-
if self.pipeline_task: body['pipeline_task'] = self.pipeline_task.as_dict()
|
|
4238
|
-
if self.python_wheel_task: body['python_wheel_task'] = self.python_wheel_task.as_dict()
|
|
4239
4274
|
if self.queue: body['queue'] = self.queue.as_dict()
|
|
4240
4275
|
if self.run_as: body['run_as'] = self.run_as.as_dict()
|
|
4241
|
-
if self.run_job_task: body['run_job_task'] = self.run_job_task.as_dict()
|
|
4242
4276
|
if self.run_name is not None: body['run_name'] = self.run_name
|
|
4243
|
-
if self.spark_jar_task: body['spark_jar_task'] = self.spark_jar_task.as_dict()
|
|
4244
|
-
if self.spark_python_task: body['spark_python_task'] = self.spark_python_task.as_dict()
|
|
4245
|
-
if self.spark_submit_task: body['spark_submit_task'] = self.spark_submit_task.as_dict()
|
|
4246
|
-
if self.sql_task: body['sql_task'] = self.sql_task.as_dict()
|
|
4247
4277
|
if self.tasks: body['tasks'] = [v.as_dict() for v in self.tasks]
|
|
4248
4278
|
if self.timeout_seconds is not None: body['timeout_seconds'] = self.timeout_seconds
|
|
4249
4279
|
if self.webhook_notifications: body['webhook_notifications'] = self.webhook_notifications.as_dict()
|
|
@@ -4252,25 +4282,16 @@ class SubmitRun:
|
|
|
4252
4282
|
@classmethod
|
|
4253
4283
|
def from_dict(cls, d: Dict[str, any]) -> SubmitRun:
|
|
4254
4284
|
"""Deserializes the SubmitRun from a dictionary."""
|
|
4255
|
-
return cls(access_control_list=_repeated_dict(d, 'access_control_list',
|
|
4256
|
-
condition_task=_from_dict(d, 'condition_task', ConditionTask),
|
|
4257
|
-
dbt_task=_from_dict(d, 'dbt_task', DbtTask),
|
|
4285
|
+
return cls(access_control_list=_repeated_dict(d, 'access_control_list', JobAccessControlRequest),
|
|
4258
4286
|
email_notifications=_from_dict(d, 'email_notifications', JobEmailNotifications),
|
|
4287
|
+
environments=_repeated_dict(d, 'environments', JobEnvironment),
|
|
4259
4288
|
git_source=_from_dict(d, 'git_source', GitSource),
|
|
4260
4289
|
health=_from_dict(d, 'health', JobsHealthRules),
|
|
4261
4290
|
idempotency_token=d.get('idempotency_token', None),
|
|
4262
|
-
notebook_task=_from_dict(d, 'notebook_task', NotebookTask),
|
|
4263
4291
|
notification_settings=_from_dict(d, 'notification_settings', JobNotificationSettings),
|
|
4264
|
-
pipeline_task=_from_dict(d, 'pipeline_task', PipelineTask),
|
|
4265
|
-
python_wheel_task=_from_dict(d, 'python_wheel_task', PythonWheelTask),
|
|
4266
4292
|
queue=_from_dict(d, 'queue', QueueSettings),
|
|
4267
4293
|
run_as=_from_dict(d, 'run_as', JobRunAs),
|
|
4268
|
-
run_job_task=_from_dict(d, 'run_job_task', RunJobTask),
|
|
4269
4294
|
run_name=d.get('run_name', None),
|
|
4270
|
-
spark_jar_task=_from_dict(d, 'spark_jar_task', SparkJarTask),
|
|
4271
|
-
spark_python_task=_from_dict(d, 'spark_python_task', SparkPythonTask),
|
|
4272
|
-
spark_submit_task=_from_dict(d, 'spark_submit_task', SparkSubmitTask),
|
|
4273
|
-
sql_task=_from_dict(d, 'sql_task', SqlTask),
|
|
4274
4295
|
tasks=_repeated_dict(d, 'tasks', SubmitTask),
|
|
4275
4296
|
timeout_seconds=d.get('timeout_seconds', None),
|
|
4276
4297
|
webhook_notifications=_from_dict(d, 'webhook_notifications', WebhookNotifications))
|
|
@@ -4307,6 +4328,10 @@ class SubmitTask:
|
|
|
4307
4328
|
execution of other tasks. Does not require a cluster to execute and does not support retries or
|
|
4308
4329
|
notifications."""
|
|
4309
4330
|
|
|
4331
|
+
dbt_task: Optional[DbtTask] = None
|
|
4332
|
+
"""If dbt_task, indicates that this must execute a dbt task. It requires both Databricks SQL and
|
|
4333
|
+
the ability to use a serverless or a pro SQL warehouse."""
|
|
4334
|
+
|
|
4310
4335
|
depends_on: Optional[List[TaskDependency]] = None
|
|
4311
4336
|
"""An optional array of objects specifying the dependency graph of the task. All tasks specified in
|
|
4312
4337
|
this field must complete successfully before executing this task. The key is `task_key`, and the
|
|
@@ -4319,6 +4344,10 @@ class SubmitTask:
|
|
|
4319
4344
|
"""An optional set of email addresses notified when the task run begins or completes. The default
|
|
4320
4345
|
behavior is to not send any emails."""
|
|
4321
4346
|
|
|
4347
|
+
environment_key: Optional[str] = None
|
|
4348
|
+
"""The key that references an environment spec in a job. This field is required for Python script,
|
|
4349
|
+
Python wheel and dbt tasks when using serverless compute."""
|
|
4350
|
+
|
|
4322
4351
|
existing_cluster_id: Optional[str] = None
|
|
4323
4352
|
"""If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running
|
|
4324
4353
|
jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops
|
|
@@ -4397,9 +4426,11 @@ class SubmitTask:
|
|
|
4397
4426
|
"""Serializes the SubmitTask into a dictionary suitable for use as a JSON request body."""
|
|
4398
4427
|
body = {}
|
|
4399
4428
|
if self.condition_task: body['condition_task'] = self.condition_task.as_dict()
|
|
4429
|
+
if self.dbt_task: body['dbt_task'] = self.dbt_task.as_dict()
|
|
4400
4430
|
if self.depends_on: body['depends_on'] = [v.as_dict() for v in self.depends_on]
|
|
4401
4431
|
if self.description is not None: body['description'] = self.description
|
|
4402
4432
|
if self.email_notifications: body['email_notifications'] = self.email_notifications.as_dict()
|
|
4433
|
+
if self.environment_key is not None: body['environment_key'] = self.environment_key
|
|
4403
4434
|
if self.existing_cluster_id is not None: body['existing_cluster_id'] = self.existing_cluster_id
|
|
4404
4435
|
if self.for_each_task: body['for_each_task'] = self.for_each_task.as_dict()
|
|
4405
4436
|
if self.health: body['health'] = self.health.as_dict()
|
|
@@ -4424,9 +4455,11 @@ class SubmitTask:
|
|
|
4424
4455
|
def from_dict(cls, d: Dict[str, any]) -> SubmitTask:
|
|
4425
4456
|
"""Deserializes the SubmitTask from a dictionary."""
|
|
4426
4457
|
return cls(condition_task=_from_dict(d, 'condition_task', ConditionTask),
|
|
4458
|
+
dbt_task=_from_dict(d, 'dbt_task', DbtTask),
|
|
4427
4459
|
depends_on=_repeated_dict(d, 'depends_on', TaskDependency),
|
|
4428
4460
|
description=d.get('description', None),
|
|
4429
4461
|
email_notifications=_from_dict(d, 'email_notifications', JobEmailNotifications),
|
|
4462
|
+
environment_key=d.get('environment_key', None),
|
|
4430
4463
|
existing_cluster_id=d.get('existing_cluster_id', None),
|
|
4431
4464
|
for_each_task=_from_dict(d, 'for_each_task', ForEachTask),
|
|
4432
4465
|
health=_from_dict(d, 'health', JobsHealthRules),
|
|
@@ -4729,6 +4762,13 @@ class TaskEmailNotifications:
|
|
|
4729
4762
|
"""A list of email addresses to be notified when a run begins. If not specified on job creation,
|
|
4730
4763
|
reset, or update, the list is empty, and notifications are not sent."""
|
|
4731
4764
|
|
|
4765
|
+
on_streaming_backlog_exceeded: Optional[List[str]] = None
|
|
4766
|
+
"""A list of email addresses to notify when any streaming backlog thresholds are exceeded for any
|
|
4767
|
+
stream. Streaming backlog thresholds can be set in the `health` field using the following
|
|
4768
|
+
metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`, `STREAMING_BACKLOG_SECONDS`, or
|
|
4769
|
+
`STREAMING_BACKLOG_FILES`. Alerting is based on the 10-minute average of these metrics. If the
|
|
4770
|
+
issue persists, notifications are resent every 30 minutes."""
|
|
4771
|
+
|
|
4732
4772
|
on_success: Optional[List[str]] = None
|
|
4733
4773
|
"""A list of email addresses to be notified when a run successfully completes. A run is considered
|
|
4734
4774
|
to have completed successfully if it ends with a `TERMINATED` `life_cycle_state` and a `SUCCESS`
|
|
@@ -4746,6 +4786,8 @@ class TaskEmailNotifications:
|
|
|
4746
4786
|
]
|
|
4747
4787
|
if self.on_failure: body['on_failure'] = [v for v in self.on_failure]
|
|
4748
4788
|
if self.on_start: body['on_start'] = [v for v in self.on_start]
|
|
4789
|
+
if self.on_streaming_backlog_exceeded:
|
|
4790
|
+
body['on_streaming_backlog_exceeded'] = [v for v in self.on_streaming_backlog_exceeded]
|
|
4749
4791
|
if self.on_success: body['on_success'] = [v for v in self.on_success]
|
|
4750
4792
|
return body
|
|
4751
4793
|
|
|
@@ -4757,6 +4799,7 @@ class TaskEmailNotifications:
|
|
|
4757
4799
|
None),
|
|
4758
4800
|
on_failure=d.get('on_failure', None),
|
|
4759
4801
|
on_start=d.get('on_start', None),
|
|
4802
|
+
on_streaming_backlog_exceeded=d.get('on_streaming_backlog_exceeded', None),
|
|
4760
4803
|
on_success=d.get('on_success', None))
|
|
4761
4804
|
|
|
4762
4805
|
|
|
@@ -4820,6 +4863,9 @@ class TriggerSettings:
|
|
|
4820
4863
|
pause_status: Optional[PauseStatus] = None
|
|
4821
4864
|
"""Whether this trigger is paused or not."""
|
|
4822
4865
|
|
|
4866
|
+
periodic: Optional[PeriodicTriggerConfiguration] = None
|
|
4867
|
+
"""Periodic trigger settings."""
|
|
4868
|
+
|
|
4823
4869
|
table: Optional[TableUpdateTriggerConfiguration] = None
|
|
4824
4870
|
"""Old table trigger settings name. Deprecated in favor of `table_update`."""
|
|
4825
4871
|
|
|
@@ -4830,6 +4876,7 @@ class TriggerSettings:
|
|
|
4830
4876
|
body = {}
|
|
4831
4877
|
if self.file_arrival: body['file_arrival'] = self.file_arrival.as_dict()
|
|
4832
4878
|
if self.pause_status is not None: body['pause_status'] = self.pause_status.value
|
|
4879
|
+
if self.periodic: body['periodic'] = self.periodic.as_dict()
|
|
4833
4880
|
if self.table: body['table'] = self.table.as_dict()
|
|
4834
4881
|
if self.table_update: body['table_update'] = self.table_update.as_dict()
|
|
4835
4882
|
return body
|
|
@@ -4839,6 +4886,7 @@ class TriggerSettings:
|
|
|
4839
4886
|
"""Deserializes the TriggerSettings from a dictionary."""
|
|
4840
4887
|
return cls(file_arrival=_from_dict(d, 'file_arrival', FileArrivalTriggerConfiguration),
|
|
4841
4888
|
pause_status=_enum(d, 'pause_status', PauseStatus),
|
|
4889
|
+
periodic=_from_dict(d, 'periodic', PeriodicTriggerConfiguration),
|
|
4842
4890
|
table=_from_dict(d, 'table', TableUpdateTriggerConfiguration),
|
|
4843
4891
|
table_update=_from_dict(d, 'table_update', TableUpdateTriggerConfiguration))
|
|
4844
4892
|
|
|
@@ -4986,6 +5034,14 @@ class WebhookNotifications:
|
|
|
4986
5034
|
"""An optional list of system notification IDs to call when the run starts. A maximum of 3
|
|
4987
5035
|
destinations can be specified for the `on_start` property."""
|
|
4988
5036
|
|
|
5037
|
+
on_streaming_backlog_exceeded: Optional[List[Webhook]] = None
|
|
5038
|
+
"""An optional list of system notification IDs to call when any streaming backlog thresholds are
|
|
5039
|
+
exceeded for any stream. Streaming backlog thresholds can be set in the `health` field using the
|
|
5040
|
+
following metrics: `STREAMING_BACKLOG_BYTES`, `STREAMING_BACKLOG_RECORDS`,
|
|
5041
|
+
`STREAMING_BACKLOG_SECONDS`, or `STREAMING_BACKLOG_FILES`. Alerting is based on the 10-minute
|
|
5042
|
+
average of these metrics. If the issue persists, notifications are resent every 30 minutes. A
|
|
5043
|
+
maximum of 3 destinations can be specified for the `on_streaming_backlog_exceeded` property."""
|
|
5044
|
+
|
|
4989
5045
|
on_success: Optional[List[Webhook]] = None
|
|
4990
5046
|
"""An optional list of system notification IDs to call when the run completes successfully. A
|
|
4991
5047
|
maximum of 3 destinations can be specified for the `on_success` property."""
|
|
@@ -4999,6 +5055,8 @@ class WebhookNotifications:
|
|
|
4999
5055
|
]
|
|
5000
5056
|
if self.on_failure: body['on_failure'] = [v.as_dict() for v in self.on_failure]
|
|
5001
5057
|
if self.on_start: body['on_start'] = [v.as_dict() for v in self.on_start]
|
|
5058
|
+
if self.on_streaming_backlog_exceeded:
|
|
5059
|
+
body['on_streaming_backlog_exceeded'] = [v.as_dict() for v in self.on_streaming_backlog_exceeded]
|
|
5002
5060
|
if self.on_success: body['on_success'] = [v.as_dict() for v in self.on_success]
|
|
5003
5061
|
return body
|
|
5004
5062
|
|
|
@@ -5009,6 +5067,7 @@ class WebhookNotifications:
|
|
|
5009
5067
|
d, 'on_duration_warning_threshold_exceeded', Webhook),
|
|
5010
5068
|
on_failure=_repeated_dict(d, 'on_failure', Webhook),
|
|
5011
5069
|
on_start=_repeated_dict(d, 'on_start', Webhook),
|
|
5070
|
+
on_streaming_backlog_exceeded=_repeated_dict(d, 'on_streaming_backlog_exceeded', Webhook),
|
|
5012
5071
|
on_success=_repeated_dict(d, 'on_success', Webhook))
|
|
5013
5072
|
|
|
5014
5073
|
|
|
@@ -5112,7 +5171,7 @@ class JobsAPI:
|
|
|
5112
5171
|
|
|
5113
5172
|
def create(self,
|
|
5114
5173
|
*,
|
|
5115
|
-
access_control_list: Optional[List[
|
|
5174
|
+
access_control_list: Optional[List[JobAccessControlRequest]] = None,
|
|
5116
5175
|
continuous: Optional[Continuous] = None,
|
|
5117
5176
|
deployment: Optional[JobDeployment] = None,
|
|
5118
5177
|
description: Optional[str] = None,
|
|
@@ -5139,7 +5198,7 @@ class JobsAPI:
|
|
|
5139
5198
|
|
|
5140
5199
|
Create a new job.
|
|
5141
5200
|
|
|
5142
|
-
:param access_control_list: List[:class:`
|
|
5201
|
+
:param access_control_list: List[:class:`JobAccessControlRequest`] (optional)
|
|
5143
5202
|
List of permissions to set on the job.
|
|
5144
5203
|
:param continuous: :class:`Continuous` (optional)
|
|
5145
5204
|
An optional continuous property for this job. The continuous property will ensure that there is
|
|
@@ -5147,7 +5206,7 @@ class JobsAPI:
|
|
|
5147
5206
|
:param deployment: :class:`JobDeployment` (optional)
|
|
5148
5207
|
Deployment information for jobs managed by external sources.
|
|
5149
5208
|
:param description: str (optional)
|
|
5150
|
-
An optional description for the job. The maximum length is
|
|
5209
|
+
An optional description for the job. The maximum length is 27700 characters in UTF-8 encoding.
|
|
5151
5210
|
:param edit_mode: :class:`JobEditMode` (optional)
|
|
5152
5211
|
Edit mode of the job.
|
|
5153
5212
|
|
|
@@ -5357,7 +5416,8 @@ class JobsAPI:
|
|
|
5357
5416
|
run_id: int,
|
|
5358
5417
|
*,
|
|
5359
5418
|
include_history: Optional[bool] = None,
|
|
5360
|
-
include_resolved_values: Optional[bool] = None
|
|
5419
|
+
include_resolved_values: Optional[bool] = None,
|
|
5420
|
+
page_token: Optional[str] = None) -> Run:
|
|
5361
5421
|
"""Get a single job run.
|
|
5362
5422
|
|
|
5363
5423
|
Retrieve the metadata of a run.
|
|
@@ -5368,6 +5428,9 @@ class JobsAPI:
|
|
|
5368
5428
|
Whether to include the repair history in the response.
|
|
5369
5429
|
:param include_resolved_values: bool (optional)
|
|
5370
5430
|
Whether to include resolved parameter values in the response.
|
|
5431
|
+
:param page_token: str (optional)
|
|
5432
|
+
To list the next page or the previous page of job tasks, set this field to the value of the
|
|
5433
|
+
`next_page_token` or `prev_page_token` returned in the GetJob response.
|
|
5371
5434
|
|
|
5372
5435
|
:returns: :class:`Run`
|
|
5373
5436
|
"""
|
|
@@ -5375,6 +5438,7 @@ class JobsAPI:
|
|
|
5375
5438
|
query = {}
|
|
5376
5439
|
if include_history is not None: query['include_history'] = include_history
|
|
5377
5440
|
if include_resolved_values is not None: query['include_resolved_values'] = include_resolved_values
|
|
5441
|
+
if page_token is not None: query['page_token'] = page_token
|
|
5378
5442
|
if run_id is not None: query['run_id'] = run_id
|
|
5379
5443
|
headers = {'Accept': 'application/json', }
|
|
5380
5444
|
|
|
@@ -5882,25 +5946,16 @@ class JobsAPI:
|
|
|
5882
5946
|
|
|
5883
5947
|
def submit(self,
|
|
5884
5948
|
*,
|
|
5885
|
-
access_control_list: Optional[List[
|
|
5886
|
-
condition_task: Optional[ConditionTask] = None,
|
|
5887
|
-
dbt_task: Optional[DbtTask] = None,
|
|
5949
|
+
access_control_list: Optional[List[JobAccessControlRequest]] = None,
|
|
5888
5950
|
email_notifications: Optional[JobEmailNotifications] = None,
|
|
5951
|
+
environments: Optional[List[JobEnvironment]] = None,
|
|
5889
5952
|
git_source: Optional[GitSource] = None,
|
|
5890
5953
|
health: Optional[JobsHealthRules] = None,
|
|
5891
5954
|
idempotency_token: Optional[str] = None,
|
|
5892
|
-
notebook_task: Optional[NotebookTask] = None,
|
|
5893
5955
|
notification_settings: Optional[JobNotificationSettings] = None,
|
|
5894
|
-
pipeline_task: Optional[PipelineTask] = None,
|
|
5895
|
-
python_wheel_task: Optional[PythonWheelTask] = None,
|
|
5896
5956
|
queue: Optional[QueueSettings] = None,
|
|
5897
5957
|
run_as: Optional[JobRunAs] = None,
|
|
5898
|
-
run_job_task: Optional[RunJobTask] = None,
|
|
5899
5958
|
run_name: Optional[str] = None,
|
|
5900
|
-
spark_jar_task: Optional[SparkJarTask] = None,
|
|
5901
|
-
spark_python_task: Optional[SparkPythonTask] = None,
|
|
5902
|
-
spark_submit_task: Optional[SparkSubmitTask] = None,
|
|
5903
|
-
sql_task: Optional[SqlTask] = None,
|
|
5904
5959
|
tasks: Optional[List[SubmitTask]] = None,
|
|
5905
5960
|
timeout_seconds: Optional[int] = None,
|
|
5906
5961
|
webhook_notifications: Optional[WebhookNotifications] = None) -> Wait[Run]:
|
|
@@ -5910,16 +5965,12 @@ class JobsAPI:
|
|
|
5910
5965
|
Runs submitted using this endpoint don’t display in the UI. Use the `jobs/runs/get` API to check the
|
|
5911
5966
|
run state after the job is submitted.
|
|
5912
5967
|
|
|
5913
|
-
:param access_control_list: List[:class:`
|
|
5968
|
+
:param access_control_list: List[:class:`JobAccessControlRequest`] (optional)
|
|
5914
5969
|
List of permissions to set on the job.
|
|
5915
|
-
:param condition_task: :class:`ConditionTask` (optional)
|
|
5916
|
-
If condition_task, specifies a condition with an outcome that can be used to control the execution
|
|
5917
|
-
of other tasks. Does not require a cluster to execute and does not support retries or notifications.
|
|
5918
|
-
:param dbt_task: :class:`DbtTask` (optional)
|
|
5919
|
-
If dbt_task, indicates that this must execute a dbt task. It requires both Databricks SQL and the
|
|
5920
|
-
ability to use a serverless or a pro SQL warehouse.
|
|
5921
5970
|
:param email_notifications: :class:`JobEmailNotifications` (optional)
|
|
5922
5971
|
An optional set of email addresses notified when the run begins or completes.
|
|
5972
|
+
:param environments: List[:class:`JobEnvironment`] (optional)
|
|
5973
|
+
A list of task execution environment specifications that can be referenced by tasks of this run.
|
|
5923
5974
|
:param git_source: :class:`GitSource` (optional)
|
|
5924
5975
|
An optional specification for a remote Git repository containing the source code used by tasks.
|
|
5925
5976
|
Version-controlled source code is supported by notebook, dbt, Python script, and SQL File tasks.
|
|
@@ -5944,47 +5995,16 @@ class JobsAPI:
|
|
|
5944
5995
|
For more information, see [How to ensure idempotency for jobs].
|
|
5945
5996
|
|
|
5946
5997
|
[How to ensure idempotency for jobs]: https://kb.databricks.com/jobs/jobs-idempotency.html
|
|
5947
|
-
:param notebook_task: :class:`NotebookTask` (optional)
|
|
5948
|
-
If notebook_task, indicates that this task must run a notebook. This field may not be specified in
|
|
5949
|
-
conjunction with spark_jar_task.
|
|
5950
5998
|
:param notification_settings: :class:`JobNotificationSettings` (optional)
|
|
5951
5999
|
Optional notification settings that are used when sending notifications to each of the
|
|
5952
6000
|
`email_notifications` and `webhook_notifications` for this run.
|
|
5953
|
-
:param pipeline_task: :class:`PipelineTask` (optional)
|
|
5954
|
-
If pipeline_task, indicates that this task must execute a Pipeline.
|
|
5955
|
-
:param python_wheel_task: :class:`PythonWheelTask` (optional)
|
|
5956
|
-
If python_wheel_task, indicates that this job must execute a PythonWheel.
|
|
5957
6001
|
:param queue: :class:`QueueSettings` (optional)
|
|
5958
6002
|
The queue settings of the one-time run.
|
|
5959
6003
|
:param run_as: :class:`JobRunAs` (optional)
|
|
5960
6004
|
Specifies the user or service principal that the job runs as. If not specified, the job runs as the
|
|
5961
6005
|
user who submits the request.
|
|
5962
|
-
:param run_job_task: :class:`RunJobTask` (optional)
|
|
5963
|
-
If run_job_task, indicates that this task must execute another job.
|
|
5964
6006
|
:param run_name: str (optional)
|
|
5965
6007
|
An optional name for the run. The default value is `Untitled`.
|
|
5966
|
-
:param spark_jar_task: :class:`SparkJarTask` (optional)
|
|
5967
|
-
If spark_jar_task, indicates that this task must run a JAR.
|
|
5968
|
-
:param spark_python_task: :class:`SparkPythonTask` (optional)
|
|
5969
|
-
If spark_python_task, indicates that this task must run a Python file.
|
|
5970
|
-
:param spark_submit_task: :class:`SparkSubmitTask` (optional)
|
|
5971
|
-
If `spark_submit_task`, indicates that this task must be launched by the spark submit script. This
|
|
5972
|
-
task can run only on new clusters.
|
|
5973
|
-
|
|
5974
|
-
In the `new_cluster` specification, `libraries` and `spark_conf` are not supported. Instead, use
|
|
5975
|
-
`--jars` and `--py-files` to add Java and Python libraries and `--conf` to set the Spark
|
|
5976
|
-
configurations.
|
|
5977
|
-
|
|
5978
|
-
`master`, `deploy-mode`, and `executor-cores` are automatically configured by Databricks; you
|
|
5979
|
-
_cannot_ specify them in parameters.
|
|
5980
|
-
|
|
5981
|
-
By default, the Spark submit job uses all available memory (excluding reserved memory for Databricks
|
|
5982
|
-
services). You can set `--driver-memory`, and `--executor-memory` to a smaller value to leave some
|
|
5983
|
-
room for off-heap usage.
|
|
5984
|
-
|
|
5985
|
-
The `--jars`, `--py-files`, `--files` arguments support DBFS and S3 paths.
|
|
5986
|
-
:param sql_task: :class:`SqlTask` (optional)
|
|
5987
|
-
If sql_task, indicates that this job must execute a SQL task.
|
|
5988
6008
|
:param tasks: List[:class:`SubmitTask`] (optional)
|
|
5989
6009
|
:param timeout_seconds: int (optional)
|
|
5990
6010
|
An optional timeout applied to each run of this job. A value of `0` means no timeout.
|
|
@@ -5998,24 +6018,15 @@ class JobsAPI:
|
|
|
5998
6018
|
body = {}
|
|
5999
6019
|
if access_control_list is not None:
|
|
6000
6020
|
body['access_control_list'] = [v.as_dict() for v in access_control_list]
|
|
6001
|
-
if condition_task is not None: body['condition_task'] = condition_task.as_dict()
|
|
6002
|
-
if dbt_task is not None: body['dbt_task'] = dbt_task.as_dict()
|
|
6003
6021
|
if email_notifications is not None: body['email_notifications'] = email_notifications.as_dict()
|
|
6022
|
+
if environments is not None: body['environments'] = [v.as_dict() for v in environments]
|
|
6004
6023
|
if git_source is not None: body['git_source'] = git_source.as_dict()
|
|
6005
6024
|
if health is not None: body['health'] = health.as_dict()
|
|
6006
6025
|
if idempotency_token is not None: body['idempotency_token'] = idempotency_token
|
|
6007
|
-
if notebook_task is not None: body['notebook_task'] = notebook_task.as_dict()
|
|
6008
6026
|
if notification_settings is not None: body['notification_settings'] = notification_settings.as_dict()
|
|
6009
|
-
if pipeline_task is not None: body['pipeline_task'] = pipeline_task.as_dict()
|
|
6010
|
-
if python_wheel_task is not None: body['python_wheel_task'] = python_wheel_task.as_dict()
|
|
6011
6027
|
if queue is not None: body['queue'] = queue.as_dict()
|
|
6012
6028
|
if run_as is not None: body['run_as'] = run_as.as_dict()
|
|
6013
|
-
if run_job_task is not None: body['run_job_task'] = run_job_task.as_dict()
|
|
6014
6029
|
if run_name is not None: body['run_name'] = run_name
|
|
6015
|
-
if spark_jar_task is not None: body['spark_jar_task'] = spark_jar_task.as_dict()
|
|
6016
|
-
if spark_python_task is not None: body['spark_python_task'] = spark_python_task.as_dict()
|
|
6017
|
-
if spark_submit_task is not None: body['spark_submit_task'] = spark_submit_task.as_dict()
|
|
6018
|
-
if sql_task is not None: body['sql_task'] = sql_task.as_dict()
|
|
6019
6030
|
if tasks is not None: body['tasks'] = [v.as_dict() for v in tasks]
|
|
6020
6031
|
if timeout_seconds is not None: body['timeout_seconds'] = timeout_seconds
|
|
6021
6032
|
if webhook_notifications is not None: body['webhook_notifications'] = webhook_notifications.as_dict()
|
|
@@ -6029,48 +6040,30 @@ class JobsAPI:
|
|
|
6029
6040
|
def submit_and_wait(
|
|
6030
6041
|
self,
|
|
6031
6042
|
*,
|
|
6032
|
-
access_control_list: Optional[List[
|
|
6033
|
-
condition_task: Optional[ConditionTask] = None,
|
|
6034
|
-
dbt_task: Optional[DbtTask] = None,
|
|
6043
|
+
access_control_list: Optional[List[JobAccessControlRequest]] = None,
|
|
6035
6044
|
email_notifications: Optional[JobEmailNotifications] = None,
|
|
6045
|
+
environments: Optional[List[JobEnvironment]] = None,
|
|
6036
6046
|
git_source: Optional[GitSource] = None,
|
|
6037
6047
|
health: Optional[JobsHealthRules] = None,
|
|
6038
6048
|
idempotency_token: Optional[str] = None,
|
|
6039
|
-
notebook_task: Optional[NotebookTask] = None,
|
|
6040
6049
|
notification_settings: Optional[JobNotificationSettings] = None,
|
|
6041
|
-
pipeline_task: Optional[PipelineTask] = None,
|
|
6042
|
-
python_wheel_task: Optional[PythonWheelTask] = None,
|
|
6043
6050
|
queue: Optional[QueueSettings] = None,
|
|
6044
6051
|
run_as: Optional[JobRunAs] = None,
|
|
6045
|
-
run_job_task: Optional[RunJobTask] = None,
|
|
6046
6052
|
run_name: Optional[str] = None,
|
|
6047
|
-
spark_jar_task: Optional[SparkJarTask] = None,
|
|
6048
|
-
spark_python_task: Optional[SparkPythonTask] = None,
|
|
6049
|
-
spark_submit_task: Optional[SparkSubmitTask] = None,
|
|
6050
|
-
sql_task: Optional[SqlTask] = None,
|
|
6051
6053
|
tasks: Optional[List[SubmitTask]] = None,
|
|
6052
6054
|
timeout_seconds: Optional[int] = None,
|
|
6053
6055
|
webhook_notifications: Optional[WebhookNotifications] = None,
|
|
6054
6056
|
timeout=timedelta(minutes=20)) -> Run:
|
|
6055
6057
|
return self.submit(access_control_list=access_control_list,
|
|
6056
|
-
condition_task=condition_task,
|
|
6057
|
-
dbt_task=dbt_task,
|
|
6058
6058
|
email_notifications=email_notifications,
|
|
6059
|
+
environments=environments,
|
|
6059
6060
|
git_source=git_source,
|
|
6060
6061
|
health=health,
|
|
6061
6062
|
idempotency_token=idempotency_token,
|
|
6062
|
-
notebook_task=notebook_task,
|
|
6063
6063
|
notification_settings=notification_settings,
|
|
6064
|
-
pipeline_task=pipeline_task,
|
|
6065
|
-
python_wheel_task=python_wheel_task,
|
|
6066
6064
|
queue=queue,
|
|
6067
6065
|
run_as=run_as,
|
|
6068
|
-
run_job_task=run_job_task,
|
|
6069
6066
|
run_name=run_name,
|
|
6070
|
-
spark_jar_task=spark_jar_task,
|
|
6071
|
-
spark_python_task=spark_python_task,
|
|
6072
|
-
spark_submit_task=spark_submit_task,
|
|
6073
|
-
sql_task=sql_task,
|
|
6074
6067
|
tasks=tasks,
|
|
6075
6068
|
timeout_seconds=timeout_seconds,
|
|
6076
6069
|
webhook_notifications=webhook_notifications).result(timeout=timeout)
|