Jobs¶
databricks_bundle_decorators.decorators.job(fn=None, *, params=None, cluster=None, libraries=None, backfill=None, **kwargs)
¶
Register a function as a Databricks job.
The function body is executed once at deploy time (when
databricks bundle deploy imports your module — not at
Databricks runtime). Inside the body, @task-decorated functions
are defined and called. Each call returns a TaskProxy;
passing a proxy to another task call records the dependency edge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
dict[str, str] | None
|
Default values for job-level parameters. Accessible inside task
functions via |
None
|
cluster
|
ClusterMeta | None
|
A |
None
|
backfill
|
BackfillDef | None
|
A |
None
|
libraries
|
list | None
|
Library dependencies to attach to each task. When |
None
|
**kwargs
|
Unpack[JobConfig]
|
Any SDK-native |
{}
|
Source code in src/databricks_bundle_decorators/decorators.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 | |
databricks_bundle_decorators.decorators.job_cluster(name, **kwargs)
¶
Register a reusable job-cluster configuration.
Cluster spec fields (spark_version, node_type_id,
num_workers, etc.) are passed as keyword arguments and forwarded
directly to the databricks.bundles.jobs.ClusterSpec constructor
at deploy time. The cluster is ephemeral: created when the job
starts and torn down when it finishes.
Returns a ClusterMeta object that should be passed directly
to @job(cluster=…).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Logical name for this cluster configuration. |
required |
**kwargs
|
Unpack[ClusterConfig]
|
Any SDK-native |
{}
|