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

@@ -356,10 +356,6 @@ class ClusterInstance:
356
356
 
357
357
  @dataclass
358
358
  class ClusterSpec:
359
- compute_key: Optional[str] = None
360
- """The key of the compute requirement, specified in `job.settings.compute`, to use for execution of
361
- this task."""
362
-
363
359
  existing_cluster_id: Optional[str] = None
364
360
  """If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running
365
361
  jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops
@@ -379,7 +375,6 @@ class ClusterSpec:
379
375
  def as_dict(self) -> dict:
380
376
  """Serializes the ClusterSpec into a dictionary suitable for use as a JSON request body."""
381
377
  body = {}
382
- if self.compute_key is not None: body['compute_key'] = self.compute_key
383
378
  if self.existing_cluster_id is not None: body['existing_cluster_id'] = self.existing_cluster_id
384
379
  if self.job_cluster_key is not None: body['job_cluster_key'] = self.job_cluster_key
385
380
  if self.libraries: body['libraries'] = [v.as_dict() for v in self.libraries]
@@ -389,8 +384,7 @@ class ClusterSpec:
389
384
  @classmethod
390
385
  def from_dict(cls, d: Dict[str, any]) -> ClusterSpec:
391
386
  """Deserializes the ClusterSpec from a dictionary."""
392
- return cls(compute_key=d.get('compute_key', None),
393
- existing_cluster_id=d.get('existing_cluster_id', None),
387
+ return cls(existing_cluster_id=d.get('existing_cluster_id', None),
394
388
  job_cluster_key=d.get('job_cluster_key', None),
395
389
  libraries=_repeated_dict(d, 'libraries', compute.Library),
396
390
  new_cluster=_from_dict(d, 'new_cluster', compute.ClusterSpec))
@@ -478,9 +472,6 @@ class CreateJob:
478
472
  access_control_list: Optional[List[iam.AccessControlRequest]] = None
479
473
  """List of permissions to set on the job."""
480
474
 
481
- compute: Optional[List[JobCompute]] = None
482
- """A list of compute requirements that can be referenced by tasks of this job."""
483
-
484
475
  continuous: Optional[Continuous] = None
485
476
  """An optional continuous property for this job. The continuous property will ensure that there is
486
477
  always one run executing. Only one of `schedule` and `continuous` can be used."""
@@ -501,6 +492,9 @@ class CreateJob:
501
492
  """An optional set of email addresses that is notified when runs of this job begin or complete as
502
493
  well as when this job is deleted."""
503
494
 
495
+ environments: Optional[List[JobEnvironment]] = None
496
+ """A list of task execution environment specifications that can be referenced by tasks of this job."""
497
+
504
498
  format: Optional[Format] = None
505
499
  """Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls.
506
500
  When using the Jobs API 2.1 this value is always set to `"MULTI_TASK"`."""
@@ -582,12 +576,12 @@ class CreateJob:
582
576
  body = {}
583
577
  if self.access_control_list:
584
578
  body['access_control_list'] = [v.as_dict() for v in self.access_control_list]
585
- if self.compute: body['compute'] = [v.as_dict() for v in self.compute]
586
579
  if self.continuous: body['continuous'] = self.continuous.as_dict()
587
580
  if self.deployment: body['deployment'] = self.deployment.as_dict()
588
581
  if self.description is not None: body['description'] = self.description
589
582
  if self.edit_mode is not None: body['edit_mode'] = self.edit_mode.value
590
583
  if self.email_notifications: body['email_notifications'] = self.email_notifications.as_dict()
584
+ if self.environments: body['environments'] = [v.as_dict() for v in self.environments]
591
585
  if self.format is not None: body['format'] = self.format.value
592
586
  if self.git_source: body['git_source'] = self.git_source.as_dict()
593
587
  if self.health: body['health'] = self.health.as_dict()
@@ -610,12 +604,12 @@ class CreateJob:
610
604
  def from_dict(cls, d: Dict[str, any]) -> CreateJob:
611
605
  """Deserializes the CreateJob from a dictionary."""
612
606
  return cls(access_control_list=_repeated_dict(d, 'access_control_list', iam.AccessControlRequest),
613
- compute=_repeated_dict(d, 'compute', JobCompute),
614
607
  continuous=_from_dict(d, 'continuous', Continuous),
615
608
  deployment=_from_dict(d, 'deployment', JobDeployment),
616
609
  description=d.get('description', None),
617
610
  edit_mode=_enum(d, 'edit_mode', JobEditMode),
618
611
  email_notifications=_from_dict(d, 'email_notifications', JobEmailNotifications),
612
+ environments=_repeated_dict(d, 'environments', JobEnvironment),
619
613
  format=_enum(d, 'format', Format),
620
614
  git_source=_from_dict(d, 'git_source', GitSource),
621
615
  health=_from_dict(d, 'health', JobsHealthRules),
@@ -1260,28 +1254,6 @@ class JobCluster:
1260
1254
  new_cluster=_from_dict(d, 'new_cluster', compute.ClusterSpec))
1261
1255
 
1262
1256
 
1263
- @dataclass
1264
- class JobCompute:
1265
- compute_key: str
1266
- """A unique name for the compute requirement. This field is required and must be unique within the
1267
- job. `JobTaskSettings` may refer to this field to determine the compute requirements for the
1268
- task execution."""
1269
-
1270
- spec: compute.ComputeSpec
1271
-
1272
- def as_dict(self) -> dict:
1273
- """Serializes the JobCompute into a dictionary suitable for use as a JSON request body."""
1274
- body = {}
1275
- if self.compute_key is not None: body['compute_key'] = self.compute_key
1276
- if self.spec: body['spec'] = self.spec.as_dict()
1277
- return body
1278
-
1279
- @classmethod
1280
- def from_dict(cls, d: Dict[str, any]) -> JobCompute:
1281
- """Deserializes the JobCompute from a dictionary."""
1282
- return cls(compute_key=d.get('compute_key', None), spec=_from_dict(d, 'spec', compute.ComputeSpec))
1283
-
1284
-
1285
1257
  @dataclass
1286
1258
  class JobDeployment:
1287
1259
  kind: JobDeploymentKind
@@ -1374,6 +1346,30 @@ class JobEmailNotifications:
1374
1346
  on_success=d.get('on_success', None))
1375
1347
 
1376
1348
 
1349
+ @dataclass
1350
+ class JobEnvironment:
1351
+ environment_key: str
1352
+ """The key of an environment. It has to be unique within a job."""
1353
+
1354
+ spec: Optional[compute.Environment] = None
1355
+ """The a environment entity used to preserve serverless environment side panel and jobs'
1356
+ environment for non-notebook task. In this minimal environment spec, only pip dependencies are
1357
+ supported. Next ID: 5"""
1358
+
1359
+ def as_dict(self) -> dict:
1360
+ """Serializes the JobEnvironment into a dictionary suitable for use as a JSON request body."""
1361
+ body = {}
1362
+ if self.environment_key is not None: body['environment_key'] = self.environment_key
1363
+ if self.spec: body['spec'] = self.spec.as_dict()
1364
+ return body
1365
+
1366
+ @classmethod
1367
+ def from_dict(cls, d: Dict[str, any]) -> JobEnvironment:
1368
+ """Deserializes the JobEnvironment from a dictionary."""
1369
+ return cls(environment_key=d.get('environment_key', None),
1370
+ spec=_from_dict(d, 'spec', compute.Environment))
1371
+
1372
+
1377
1373
  @dataclass
1378
1374
  class JobNotificationSettings:
1379
1375
  no_alert_for_canceled_runs: Optional[bool] = None
@@ -1582,9 +1578,6 @@ class JobRunAs:
1582
1578
 
1583
1579
  @dataclass
1584
1580
  class JobSettings:
1585
- compute: Optional[List[JobCompute]] = None
1586
- """A list of compute requirements that can be referenced by tasks of this job."""
1587
-
1588
1581
  continuous: Optional[Continuous] = None
1589
1582
  """An optional continuous property for this job. The continuous property will ensure that there is
1590
1583
  always one run executing. Only one of `schedule` and `continuous` can be used."""
@@ -1605,6 +1598,9 @@ class JobSettings:
1605
1598
  """An optional set of email addresses that is notified when runs of this job begin or complete as
1606
1599
  well as when this job is deleted."""
1607
1600
 
1601
+ environments: Optional[List[JobEnvironment]] = None
1602
+ """A list of task execution environment specifications that can be referenced by tasks of this job."""
1603
+
1608
1604
  format: Optional[Format] = None
1609
1605
  """Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls.
1610
1606
  When using the Jobs API 2.1 this value is always set to `"MULTI_TASK"`."""
@@ -1684,12 +1680,12 @@ class JobSettings:
1684
1680
  def as_dict(self) -> dict:
1685
1681
  """Serializes the JobSettings into a dictionary suitable for use as a JSON request body."""
1686
1682
  body = {}
1687
- if self.compute: body['compute'] = [v.as_dict() for v in self.compute]
1688
1683
  if self.continuous: body['continuous'] = self.continuous.as_dict()
1689
1684
  if self.deployment: body['deployment'] = self.deployment.as_dict()
1690
1685
  if self.description is not None: body['description'] = self.description
1691
1686
  if self.edit_mode is not None: body['edit_mode'] = self.edit_mode.value
1692
1687
  if self.email_notifications: body['email_notifications'] = self.email_notifications.as_dict()
1688
+ if self.environments: body['environments'] = [v.as_dict() for v in self.environments]
1693
1689
  if self.format is not None: body['format'] = self.format.value
1694
1690
  if self.git_source: body['git_source'] = self.git_source.as_dict()
1695
1691
  if self.health: body['health'] = self.health.as_dict()
@@ -1711,12 +1707,12 @@ class JobSettings:
1711
1707
  @classmethod
1712
1708
  def from_dict(cls, d: Dict[str, any]) -> JobSettings:
1713
1709
  """Deserializes the JobSettings from a dictionary."""
1714
- return cls(compute=_repeated_dict(d, 'compute', JobCompute),
1715
- continuous=_from_dict(d, 'continuous', Continuous),
1710
+ return cls(continuous=_from_dict(d, 'continuous', Continuous),
1716
1711
  deployment=_from_dict(d, 'deployment', JobDeployment),
1717
1712
  description=d.get('description', None),
1718
1713
  edit_mode=_enum(d, 'edit_mode', JobEditMode),
1719
1714
  email_notifications=_from_dict(d, 'email_notifications', JobEmailNotifications),
1715
+ environments=_repeated_dict(d, 'environments', JobEnvironment),
1720
1716
  format=_enum(d, 'format', Format),
1721
1717
  git_source=_from_dict(d, 'git_source', GitSource),
1722
1718
  health=_from_dict(d, 'health', JobsHealthRules),
@@ -3366,10 +3362,6 @@ class RunTask:
3366
3362
  """The cluster used for this run. If the run is specified to use a new cluster, this field is set
3367
3363
  once the Jobs service has requested a cluster for the run."""
3368
3364
 
3369
- compute_key: Optional[str] = None
3370
- """The key of the compute requirement, specified in `job.settings.compute`, to use for execution of
3371
- this task."""
3372
-
3373
3365
  condition_task: Optional[RunConditionTask] = None
3374
3366
  """If condition_task, specifies a condition with an outcome that can be used to control the
3375
3367
  execution of other tasks. Does not require a cluster to execute and does not support retries or
@@ -3520,7 +3512,6 @@ class RunTask:
3520
3512
  if self.attempt_number is not None: body['attempt_number'] = self.attempt_number
3521
3513
  if self.cleanup_duration is not None: body['cleanup_duration'] = self.cleanup_duration
3522
3514
  if self.cluster_instance: body['cluster_instance'] = self.cluster_instance.as_dict()
3523
- if self.compute_key is not None: body['compute_key'] = self.compute_key
3524
3515
  if self.condition_task: body['condition_task'] = self.condition_task.as_dict()
3525
3516
  if self.dbt_task: body['dbt_task'] = self.dbt_task.as_dict()
3526
3517
  if self.depends_on: body['depends_on'] = [v.as_dict() for v in self.depends_on]
@@ -3563,7 +3554,6 @@ class RunTask:
3563
3554
  return cls(attempt_number=d.get('attempt_number', None),
3564
3555
  cleanup_duration=d.get('cleanup_duration', None),
3565
3556
  cluster_instance=_from_dict(d, 'cluster_instance', ClusterInstance),
3566
- compute_key=d.get('compute_key', None),
3567
3557
  condition_task=_from_dict(d, 'condition_task', RunConditionTask),
3568
3558
  dbt_task=_from_dict(d, 'dbt_task', DbtTask),
3569
3559
  depends_on=_repeated_dict(d, 'depends_on', TaskDependency),
@@ -4450,7 +4440,7 @@ class SubmitTask:
4450
4440
 
4451
4441
 
4452
4442
  @dataclass
4453
- class TableTriggerConfiguration:
4443
+ class TableUpdateTriggerConfiguration:
4454
4444
  condition: Optional[Condition] = None
4455
4445
  """The table(s) condition based on which to trigger a job run."""
4456
4446
 
@@ -4468,7 +4458,7 @@ class TableTriggerConfiguration:
4468
4458
  allowed value is 60 seconds."""
4469
4459
 
4470
4460
  def as_dict(self) -> dict:
4471
- """Serializes the TableTriggerConfiguration into a dictionary suitable for use as a JSON request body."""
4461
+ """Serializes the TableUpdateTriggerConfiguration into a dictionary suitable for use as a JSON request body."""
4472
4462
  body = {}
4473
4463
  if self.condition is not None: body['condition'] = self.condition.value
4474
4464
  if self.min_time_between_triggers_seconds is not None:
@@ -4479,8 +4469,8 @@ class TableTriggerConfiguration:
4479
4469
  return body
4480
4470
 
4481
4471
  @classmethod
4482
- def from_dict(cls, d: Dict[str, any]) -> TableTriggerConfiguration:
4483
- """Deserializes the TableTriggerConfiguration from a dictionary."""
4472
+ def from_dict(cls, d: Dict[str, any]) -> TableUpdateTriggerConfiguration:
4473
+ """Deserializes the TableUpdateTriggerConfiguration from a dictionary."""
4484
4474
  return cls(condition=_enum(d, 'condition', Condition),
4485
4475
  min_time_between_triggers_seconds=d.get('min_time_between_triggers_seconds', None),
4486
4476
  table_names=d.get('table_names', None),
@@ -4494,10 +4484,6 @@ class Task:
4494
4484
  field is required and must be unique within its parent job. On Update or Reset, this field is
4495
4485
  used to reference the tasks to be updated or reset."""
4496
4486
 
4497
- compute_key: Optional[str] = None
4498
- """The key of the compute requirement, specified in `job.settings.compute`, to use for execution of
4499
- this task."""
4500
-
4501
4487
  condition_task: Optional[ConditionTask] = None
4502
4488
  """If condition_task, specifies a condition with an outcome that can be used to control the
4503
4489
  execution of other tasks. Does not require a cluster to execute and does not support retries or
@@ -4523,6 +4509,10 @@ class Task:
4523
4509
  """An optional set of email addresses that is notified when runs of this task begin or complete as
4524
4510
  well as when this task is deleted. The default behavior is to not send any emails."""
4525
4511
 
4512
+ environment_key: Optional[str] = None
4513
+ """The key that references an environment spec in a job. This field is required for Python script,
4514
+ Python wheel and dbt tasks when using serverless compute."""
4515
+
4526
4516
  existing_cluster_id: Optional[str] = None
4527
4517
  """If existing_cluster_id, the ID of an existing cluster that is used for all runs. When running
4528
4518
  jobs or tasks on an existing cluster, you may need to manually restart the cluster if it stops
@@ -4621,7 +4611,6 @@ class Task:
4621
4611
  def as_dict(self) -> dict:
4622
4612
  """Serializes the Task into a dictionary suitable for use as a JSON request body."""
4623
4613
  body = {}
4624
- if self.compute_key is not None: body['compute_key'] = self.compute_key
4625
4614
  if self.condition_task: body['condition_task'] = self.condition_task.as_dict()
4626
4615
  if self.dbt_task: body['dbt_task'] = self.dbt_task.as_dict()
4627
4616
  if self.depends_on: body['depends_on'] = [v.as_dict() for v in self.depends_on]
@@ -4629,6 +4618,7 @@ class Task:
4629
4618
  if self.disable_auto_optimization is not None:
4630
4619
  body['disable_auto_optimization'] = self.disable_auto_optimization
4631
4620
  if self.email_notifications: body['email_notifications'] = self.email_notifications.as_dict()
4621
+ if self.environment_key is not None: body['environment_key'] = self.environment_key
4632
4622
  if self.existing_cluster_id is not None: body['existing_cluster_id'] = self.existing_cluster_id
4633
4623
  if self.for_each_task: body['for_each_task'] = self.for_each_task.as_dict()
4634
4624
  if self.health: body['health'] = self.health.as_dict()
@@ -4657,13 +4647,13 @@ class Task:
4657
4647
  @classmethod
4658
4648
  def from_dict(cls, d: Dict[str, any]) -> Task:
4659
4649
  """Deserializes the Task from a dictionary."""
4660
- return cls(compute_key=d.get('compute_key', None),
4661
- condition_task=_from_dict(d, 'condition_task', ConditionTask),
4650
+ return cls(condition_task=_from_dict(d, 'condition_task', ConditionTask),
4662
4651
  dbt_task=_from_dict(d, 'dbt_task', DbtTask),
4663
4652
  depends_on=_repeated_dict(d, 'depends_on', TaskDependency),
4664
4653
  description=d.get('description', None),
4665
4654
  disable_auto_optimization=d.get('disable_auto_optimization', None),
4666
4655
  email_notifications=_from_dict(d, 'email_notifications', TaskEmailNotifications),
4656
+ environment_key=d.get('environment_key', None),
4667
4657
  existing_cluster_id=d.get('existing_cluster_id', None),
4668
4658
  for_each_task=_from_dict(d, 'for_each_task', ForEachTask),
4669
4659
  health=_from_dict(d, 'health', JobsHealthRules),
@@ -4822,10 +4812,10 @@ class TriggerSettings:
4822
4812
  pause_status: Optional[PauseStatus] = None
4823
4813
  """Whether this trigger is paused or not."""
4824
4814
 
4825
- table: Optional[TableTriggerConfiguration] = None
4815
+ table: Optional[TableUpdateTriggerConfiguration] = None
4826
4816
  """Old table trigger settings name. Deprecated in favor of `table_update`."""
4827
4817
 
4828
- table_update: Optional[TableTriggerConfiguration] = None
4818
+ table_update: Optional[TableUpdateTriggerConfiguration] = None
4829
4819
 
4830
4820
  def as_dict(self) -> dict:
4831
4821
  """Serializes the TriggerSettings into a dictionary suitable for use as a JSON request body."""
@@ -4841,8 +4831,8 @@ class TriggerSettings:
4841
4831
  """Deserializes the TriggerSettings from a dictionary."""
4842
4832
  return cls(file_arrival=_from_dict(d, 'file_arrival', FileArrivalTriggerConfiguration),
4843
4833
  pause_status=_enum(d, 'pause_status', PauseStatus),
4844
- table=_from_dict(d, 'table', TableTriggerConfiguration),
4845
- table_update=_from_dict(d, 'table_update', TableTriggerConfiguration))
4834
+ table=_from_dict(d, 'table', TableUpdateTriggerConfiguration),
4835
+ table_update=_from_dict(d, 'table_update', TableUpdateTriggerConfiguration))
4846
4836
 
4847
4837
 
4848
4838
  class TriggerType(Enum):
@@ -5115,12 +5105,12 @@ class JobsAPI:
5115
5105
  def create(self,
5116
5106
  *,
5117
5107
  access_control_list: Optional[List[iam.AccessControlRequest]] = None,
5118
- compute: Optional[List[JobCompute]] = None,
5119
5108
  continuous: Optional[Continuous] = None,
5120
5109
  deployment: Optional[JobDeployment] = None,
5121
5110
  description: Optional[str] = None,
5122
5111
  edit_mode: Optional[JobEditMode] = None,
5123
5112
  email_notifications: Optional[JobEmailNotifications] = None,
5113
+ environments: Optional[List[JobEnvironment]] = None,
5124
5114
  format: Optional[Format] = None,
5125
5115
  git_source: Optional[GitSource] = None,
5126
5116
  health: Optional[JobsHealthRules] = None,
@@ -5143,8 +5133,6 @@ class JobsAPI:
5143
5133
 
5144
5134
  :param access_control_list: List[:class:`AccessControlRequest`] (optional)
5145
5135
  List of permissions to set on the job.
5146
- :param compute: List[:class:`JobCompute`] (optional)
5147
- A list of compute requirements that can be referenced by tasks of this job.
5148
5136
  :param continuous: :class:`Continuous` (optional)
5149
5137
  An optional continuous property for this job. The continuous property will ensure that there is
5150
5138
  always one run executing. Only one of `schedule` and `continuous` can be used.
@@ -5160,6 +5148,8 @@ class JobsAPI:
5160
5148
  :param email_notifications: :class:`JobEmailNotifications` (optional)
5161
5149
  An optional set of email addresses that is notified when runs of this job begin or complete as well
5162
5150
  as when this job is deleted.
5151
+ :param environments: List[:class:`JobEnvironment`] (optional)
5152
+ A list of task execution environment specifications that can be referenced by tasks of this job.
5163
5153
  :param format: :class:`Format` (optional)
5164
5154
  Used to tell what is the format of the job. This field is ignored in Create/Update/Reset calls. When
5165
5155
  using the Jobs API 2.1 this value is always set to `"MULTI_TASK"`.
@@ -5225,12 +5215,12 @@ class JobsAPI:
5225
5215
  body = {}
5226
5216
  if access_control_list is not None:
5227
5217
  body['access_control_list'] = [v.as_dict() for v in access_control_list]
5228
- if compute is not None: body['compute'] = [v.as_dict() for v in compute]
5229
5218
  if continuous is not None: body['continuous'] = continuous.as_dict()
5230
5219
  if deployment is not None: body['deployment'] = deployment.as_dict()
5231
5220
  if description is not None: body['description'] = description
5232
5221
  if edit_mode is not None: body['edit_mode'] = edit_mode.value
5233
5222
  if email_notifications is not None: body['email_notifications'] = email_notifications.as_dict()
5223
+ if environments is not None: body['environments'] = [v.as_dict() for v in environments]
5234
5224
  if format is not None: body['format'] = format.value
5235
5225
  if git_source is not None: body['git_source'] = git_source.as_dict()
5236
5226
  if health is not None: body['health'] = health.as_dict()