@fabricorg/databricks-testkit 0.2.4 → 0.4.0
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.
- package/README.md +31 -0
- package/dist/index.cjs +841 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +257 -1
- package/dist/index.d.ts +257 -1
- package/dist/index.js +821 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -209,6 +209,23 @@ interface LiveCheckResult {
|
|
|
209
209
|
details?: unknown;
|
|
210
210
|
error?: string;
|
|
211
211
|
}
|
|
212
|
+
type TargetPackMaturity = 'proposed' | 'building' | 'shipped' | 'live-gated' | 'certifying' | 'certified';
|
|
213
|
+
interface TargetPackEvidenceMetadata {
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
version: string;
|
|
217
|
+
maturity: TargetPackMaturity;
|
|
218
|
+
capabilities: string[];
|
|
219
|
+
docsUrl?: string;
|
|
220
|
+
certificationScopes: string[];
|
|
221
|
+
target: {
|
|
222
|
+
cloud?: string;
|
|
223
|
+
region?: string;
|
|
224
|
+
workspace?: string;
|
|
225
|
+
runtime?: string;
|
|
226
|
+
compute?: string;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
212
229
|
interface LiveEvidence {
|
|
213
230
|
schemaVersion: 1;
|
|
214
231
|
kind: 'databricks-live-suite';
|
|
@@ -217,6 +234,7 @@ interface LiveEvidence {
|
|
|
217
234
|
success: boolean;
|
|
218
235
|
required: string[];
|
|
219
236
|
results: LiveCheckResult[];
|
|
237
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
220
238
|
}
|
|
221
239
|
interface LiveSuiteSpec {
|
|
222
240
|
checks: readonly LiveCheck[];
|
|
@@ -224,6 +242,7 @@ interface LiveSuiteSpec {
|
|
|
224
242
|
evidencePath?: string;
|
|
225
243
|
junitPath?: string;
|
|
226
244
|
env?: Record<string, string | undefined>;
|
|
245
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
227
246
|
}
|
|
228
247
|
interface LiveSuiteRuntime {
|
|
229
248
|
warehouse?: ExecutionContext;
|
|
@@ -351,4 +370,241 @@ declare function serverlessComputeCheck(): LiveCheck;
|
|
|
351
370
|
/** Launch a disposable classic job cluster and require the shared notebook probe to succeed. */
|
|
352
371
|
declare function classicComputeCheck(): LiveCheck;
|
|
353
372
|
|
|
354
|
-
|
|
373
|
+
interface TargetPackRequirement {
|
|
374
|
+
id: string;
|
|
375
|
+
description: string;
|
|
376
|
+
/** At least one named environment variable must be present. */
|
|
377
|
+
anyOf: readonly string[];
|
|
378
|
+
required?: boolean;
|
|
379
|
+
secret?: boolean;
|
|
380
|
+
}
|
|
381
|
+
interface TargetPackSpec {
|
|
382
|
+
id: string;
|
|
383
|
+
name: string;
|
|
384
|
+
description: string;
|
|
385
|
+
version: string;
|
|
386
|
+
maturity: TargetPackMaturity;
|
|
387
|
+
capabilities: readonly string[];
|
|
388
|
+
checks: readonly LiveCheck[] | (() => readonly LiveCheck[]);
|
|
389
|
+
requiredChecks?: readonly string[];
|
|
390
|
+
requirements?: readonly TargetPackRequirement[];
|
|
391
|
+
docsUrl?: string;
|
|
392
|
+
certificationScopes?: readonly string[];
|
|
393
|
+
}
|
|
394
|
+
interface TargetPack extends Omit<TargetPackSpec, 'checks'> {
|
|
395
|
+
checks(): readonly LiveCheck[];
|
|
396
|
+
}
|
|
397
|
+
interface TargetPackDoctorRequirement {
|
|
398
|
+
id: string;
|
|
399
|
+
description: string;
|
|
400
|
+
satisfied: boolean;
|
|
401
|
+
required: boolean;
|
|
402
|
+
variables: string[];
|
|
403
|
+
}
|
|
404
|
+
interface TargetPackDoctorCheck {
|
|
405
|
+
id: string;
|
|
406
|
+
description: string;
|
|
407
|
+
configured: boolean;
|
|
408
|
+
required: boolean;
|
|
409
|
+
}
|
|
410
|
+
interface TargetPackDoctorResult {
|
|
411
|
+
pack: Pick<TargetPack, 'id' | 'name' | 'version' | 'maturity'>;
|
|
412
|
+
ready: boolean;
|
|
413
|
+
requirements: TargetPackDoctorRequirement[];
|
|
414
|
+
checks: TargetPackDoctorCheck[];
|
|
415
|
+
missingRequirements: string[];
|
|
416
|
+
missingRequiredChecks: string[];
|
|
417
|
+
}
|
|
418
|
+
interface RunTargetPackOptions {
|
|
419
|
+
env?: Record<string, string | undefined>;
|
|
420
|
+
requiredChecks?: readonly string[];
|
|
421
|
+
evidencePath?: string;
|
|
422
|
+
junitPath?: string;
|
|
423
|
+
}
|
|
424
|
+
interface DefinedTargetPackRun {
|
|
425
|
+
pack: TargetPack;
|
|
426
|
+
run(runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
427
|
+
}
|
|
428
|
+
declare function defineTargetPack(spec: TargetPackSpec): TargetPack;
|
|
429
|
+
declare function createTargetPackRegistry(packs: readonly TargetPack[]): ReadonlyMap<string, TargetPack>;
|
|
430
|
+
declare function doctorTargetPack(pack: TargetPack, env?: Record<string, string | undefined>, requiredChecks?: readonly string[]): TargetPackDoctorResult;
|
|
431
|
+
declare function defineTargetPackRun(pack: TargetPack, options?: RunTargetPackOptions): DefinedTargetPackRun;
|
|
432
|
+
declare function runTargetPack(pack: TargetPack, options?: RunTargetPackOptions, runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
433
|
+
|
|
434
|
+
declare function createSqlDeltaFoundationPack(): TargetPack;
|
|
435
|
+
declare function createLakeflowFoundationPack(): TargetPack;
|
|
436
|
+
declare function createJobsCodeFoundationPack(): TargetPack;
|
|
437
|
+
declare function createUnityStorageFoundationPack(): TargetPack;
|
|
438
|
+
declare function createAppsOperationalFoundationPack(): TargetPack;
|
|
439
|
+
declare function createFoundationTargetPacks(): readonly TargetPack[];
|
|
440
|
+
declare const foundationTargetPacks: readonly TargetPack[];
|
|
441
|
+
|
|
442
|
+
interface JobTaskDependency {
|
|
443
|
+
task_key: string;
|
|
444
|
+
outcome?: string;
|
|
445
|
+
}
|
|
446
|
+
interface JobTaskBase {
|
|
447
|
+
task_key: string;
|
|
448
|
+
depends_on?: JobTaskDependency[];
|
|
449
|
+
run_if?: 'ALL_SUCCESS' | 'AT_LEAST_ONE_SUCCESS' | 'NONE_FAILED' | 'ALL_DONE' | 'AT_LEAST_ONE_FAILED' | 'ALL_FAILED';
|
|
450
|
+
timeout_seconds?: number;
|
|
451
|
+
max_retries?: number;
|
|
452
|
+
min_retry_interval_millis?: number;
|
|
453
|
+
retry_on_timeout?: boolean;
|
|
454
|
+
existing_cluster_id?: string;
|
|
455
|
+
job_cluster_key?: string;
|
|
456
|
+
environment_key?: string;
|
|
457
|
+
}
|
|
458
|
+
interface NotebookJobTask extends JobTaskBase {
|
|
459
|
+
notebook_task: {
|
|
460
|
+
notebook_path: string;
|
|
461
|
+
base_parameters?: Record<string, string>;
|
|
462
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
interface PythonWheelJobTask extends JobTaskBase {
|
|
466
|
+
python_wheel_task: {
|
|
467
|
+
package_name: string;
|
|
468
|
+
entry_point: string;
|
|
469
|
+
parameters?: string[];
|
|
470
|
+
named_parameters?: Record<string, string>;
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
interface SparkJarJobTask extends JobTaskBase {
|
|
474
|
+
spark_jar_task: {
|
|
475
|
+
main_class_name: string;
|
|
476
|
+
parameters?: string[];
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
interface SparkPythonJobTask extends JobTaskBase {
|
|
480
|
+
spark_python_task: {
|
|
481
|
+
python_file: string;
|
|
482
|
+
parameters?: string[];
|
|
483
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
interface SparkSubmitJobTask extends JobTaskBase {
|
|
487
|
+
spark_submit_task: {
|
|
488
|
+
parameters: string[];
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
interface PipelineJobTask extends JobTaskBase {
|
|
492
|
+
pipeline_task: {
|
|
493
|
+
pipeline_id: string;
|
|
494
|
+
full_refresh?: boolean;
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
interface SqlJobTask extends JobTaskBase {
|
|
498
|
+
sql_task: Record<string, unknown> & {
|
|
499
|
+
warehouse_id: string;
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
interface DbtJobTask extends JobTaskBase {
|
|
503
|
+
dbt_task: Record<string, unknown> & {
|
|
504
|
+
commands: string[];
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
interface RunJobTask extends JobTaskBase {
|
|
508
|
+
run_job_task: {
|
|
509
|
+
job_id: number;
|
|
510
|
+
job_parameters?: Record<string, string>;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
interface ConditionJobTask extends JobTaskBase {
|
|
514
|
+
condition_task: {
|
|
515
|
+
left: string;
|
|
516
|
+
op: 'EQUAL_TO' | 'NOT_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL';
|
|
517
|
+
right: string;
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
interface ForEachJobTask extends JobTaskBase {
|
|
521
|
+
for_each_task: {
|
|
522
|
+
inputs: string;
|
|
523
|
+
concurrency?: number;
|
|
524
|
+
task: Exclude<DatabricksJobTask, ForEachJobTask>;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
type DatabricksJobTask = NotebookJobTask | PythonWheelJobTask | SparkJarJobTask | SparkPythonJobTask | SparkSubmitJobTask | PipelineJobTask | SqlJobTask | DbtJobTask | RunJobTask | ConditionJobTask | ForEachJobTask;
|
|
528
|
+
interface JobsSubmitRequest {
|
|
529
|
+
run_name: string;
|
|
530
|
+
tasks: DatabricksJobTask[];
|
|
531
|
+
parameters?: Array<{
|
|
532
|
+
name: string;
|
|
533
|
+
default: string;
|
|
534
|
+
}>;
|
|
535
|
+
job_clusters?: Array<Record<string, unknown> & {
|
|
536
|
+
job_cluster_key: string;
|
|
537
|
+
}>;
|
|
538
|
+
environments?: Array<Record<string, unknown> & {
|
|
539
|
+
environment_key: string;
|
|
540
|
+
}>;
|
|
541
|
+
git_source?: Record<string, unknown>;
|
|
542
|
+
timeout_seconds?: number;
|
|
543
|
+
idempotency_token?: string;
|
|
544
|
+
}
|
|
545
|
+
interface JobTaskRunState {
|
|
546
|
+
taskKey: string;
|
|
547
|
+
runId?: number;
|
|
548
|
+
lifeCycleState: string;
|
|
549
|
+
resultState: string;
|
|
550
|
+
stateMessage?: string;
|
|
551
|
+
attemptNumber?: number;
|
|
552
|
+
}
|
|
553
|
+
interface JobOrchestrationRun {
|
|
554
|
+
runId: number;
|
|
555
|
+
lifeCycleState: string;
|
|
556
|
+
resultState: string;
|
|
557
|
+
tasks: JobTaskRunState[];
|
|
558
|
+
repairs: JobRepairRunState[];
|
|
559
|
+
raw: Record<string, unknown>;
|
|
560
|
+
}
|
|
561
|
+
interface JobRepairRunState {
|
|
562
|
+
repairId: number;
|
|
563
|
+
type: string;
|
|
564
|
+
lifeCycleState: string;
|
|
565
|
+
resultState: string;
|
|
566
|
+
taskRunIds: number[];
|
|
567
|
+
}
|
|
568
|
+
interface JobWaitOptions {
|
|
569
|
+
timeoutMs?: number;
|
|
570
|
+
pollIntervalMs?: number;
|
|
571
|
+
}
|
|
572
|
+
interface JobRepairOptions {
|
|
573
|
+
rerunTasks?: string[];
|
|
574
|
+
latestRepairId?: number;
|
|
575
|
+
rerunDependentTasks?: boolean;
|
|
576
|
+
}
|
|
577
|
+
interface JobOrchestrationLiveSpec {
|
|
578
|
+
request: JobsSubmitRequest;
|
|
579
|
+
expectedResult?: string;
|
|
580
|
+
expectedTasks?: Record<string, string>;
|
|
581
|
+
repairFailedTasks?: boolean;
|
|
582
|
+
cancellation?: {
|
|
583
|
+
request: JobsSubmitRequest;
|
|
584
|
+
expectedResult?: string;
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
declare class DatabricksJobsAdapter {
|
|
588
|
+
private readonly client;
|
|
589
|
+
constructor(client: WorkspaceClientLike);
|
|
590
|
+
submit(request: JobsSubmitRequest): Promise<number>;
|
|
591
|
+
get(runId: number): Promise<JobOrchestrationRun>;
|
|
592
|
+
wait(runId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
593
|
+
cancel(runId: number): Promise<void>;
|
|
594
|
+
waitUntilActive(runId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
595
|
+
repair(runId: number, options?: JobRepairOptions): Promise<number>;
|
|
596
|
+
waitForRepair(runId: number, repairId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
597
|
+
}
|
|
598
|
+
declare function validateJobGraph(tasks: readonly DatabricksJobTask[]): void;
|
|
599
|
+
declare function jobsOrchestrationCheck(): LiveCheck;
|
|
600
|
+
declare function parseJobOrchestrationLiveSpec(value: string): JobOrchestrationLiveSpec;
|
|
601
|
+
declare function normalizeJobRun(fallbackRunId: number, raw: Record<string, unknown>): JobOrchestrationRun;
|
|
602
|
+
|
|
603
|
+
declare function jobsCertificationCheck(): LiveCheck;
|
|
604
|
+
|
|
605
|
+
declare function createLakeflowJobsTargetPack(): TargetPack;
|
|
606
|
+
|
|
607
|
+
declare function createBuiltinTargetPacks(): readonly TargetPack[];
|
|
608
|
+
declare const builtinTargetPacks: readonly TargetPack[];
|
|
609
|
+
|
|
610
|
+
export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobRepairRunState, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMockDatabricksClient, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, foundationTargetPacks, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, volumeIOCheck, waitForPipelineUpdate };
|
package/dist/index.d.ts
CHANGED
|
@@ -209,6 +209,23 @@ interface LiveCheckResult {
|
|
|
209
209
|
details?: unknown;
|
|
210
210
|
error?: string;
|
|
211
211
|
}
|
|
212
|
+
type TargetPackMaturity = 'proposed' | 'building' | 'shipped' | 'live-gated' | 'certifying' | 'certified';
|
|
213
|
+
interface TargetPackEvidenceMetadata {
|
|
214
|
+
id: string;
|
|
215
|
+
name: string;
|
|
216
|
+
version: string;
|
|
217
|
+
maturity: TargetPackMaturity;
|
|
218
|
+
capabilities: string[];
|
|
219
|
+
docsUrl?: string;
|
|
220
|
+
certificationScopes: string[];
|
|
221
|
+
target: {
|
|
222
|
+
cloud?: string;
|
|
223
|
+
region?: string;
|
|
224
|
+
workspace?: string;
|
|
225
|
+
runtime?: string;
|
|
226
|
+
compute?: string;
|
|
227
|
+
};
|
|
228
|
+
}
|
|
212
229
|
interface LiveEvidence {
|
|
213
230
|
schemaVersion: 1;
|
|
214
231
|
kind: 'databricks-live-suite';
|
|
@@ -217,6 +234,7 @@ interface LiveEvidence {
|
|
|
217
234
|
success: boolean;
|
|
218
235
|
required: string[];
|
|
219
236
|
results: LiveCheckResult[];
|
|
237
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
220
238
|
}
|
|
221
239
|
interface LiveSuiteSpec {
|
|
222
240
|
checks: readonly LiveCheck[];
|
|
@@ -224,6 +242,7 @@ interface LiveSuiteSpec {
|
|
|
224
242
|
evidencePath?: string;
|
|
225
243
|
junitPath?: string;
|
|
226
244
|
env?: Record<string, string | undefined>;
|
|
245
|
+
targetPack?: TargetPackEvidenceMetadata;
|
|
227
246
|
}
|
|
228
247
|
interface LiveSuiteRuntime {
|
|
229
248
|
warehouse?: ExecutionContext;
|
|
@@ -351,4 +370,241 @@ declare function serverlessComputeCheck(): LiveCheck;
|
|
|
351
370
|
/** Launch a disposable classic job cluster and require the shared notebook probe to succeed. */
|
|
352
371
|
declare function classicComputeCheck(): LiveCheck;
|
|
353
372
|
|
|
354
|
-
|
|
373
|
+
interface TargetPackRequirement {
|
|
374
|
+
id: string;
|
|
375
|
+
description: string;
|
|
376
|
+
/** At least one named environment variable must be present. */
|
|
377
|
+
anyOf: readonly string[];
|
|
378
|
+
required?: boolean;
|
|
379
|
+
secret?: boolean;
|
|
380
|
+
}
|
|
381
|
+
interface TargetPackSpec {
|
|
382
|
+
id: string;
|
|
383
|
+
name: string;
|
|
384
|
+
description: string;
|
|
385
|
+
version: string;
|
|
386
|
+
maturity: TargetPackMaturity;
|
|
387
|
+
capabilities: readonly string[];
|
|
388
|
+
checks: readonly LiveCheck[] | (() => readonly LiveCheck[]);
|
|
389
|
+
requiredChecks?: readonly string[];
|
|
390
|
+
requirements?: readonly TargetPackRequirement[];
|
|
391
|
+
docsUrl?: string;
|
|
392
|
+
certificationScopes?: readonly string[];
|
|
393
|
+
}
|
|
394
|
+
interface TargetPack extends Omit<TargetPackSpec, 'checks'> {
|
|
395
|
+
checks(): readonly LiveCheck[];
|
|
396
|
+
}
|
|
397
|
+
interface TargetPackDoctorRequirement {
|
|
398
|
+
id: string;
|
|
399
|
+
description: string;
|
|
400
|
+
satisfied: boolean;
|
|
401
|
+
required: boolean;
|
|
402
|
+
variables: string[];
|
|
403
|
+
}
|
|
404
|
+
interface TargetPackDoctorCheck {
|
|
405
|
+
id: string;
|
|
406
|
+
description: string;
|
|
407
|
+
configured: boolean;
|
|
408
|
+
required: boolean;
|
|
409
|
+
}
|
|
410
|
+
interface TargetPackDoctorResult {
|
|
411
|
+
pack: Pick<TargetPack, 'id' | 'name' | 'version' | 'maturity'>;
|
|
412
|
+
ready: boolean;
|
|
413
|
+
requirements: TargetPackDoctorRequirement[];
|
|
414
|
+
checks: TargetPackDoctorCheck[];
|
|
415
|
+
missingRequirements: string[];
|
|
416
|
+
missingRequiredChecks: string[];
|
|
417
|
+
}
|
|
418
|
+
interface RunTargetPackOptions {
|
|
419
|
+
env?: Record<string, string | undefined>;
|
|
420
|
+
requiredChecks?: readonly string[];
|
|
421
|
+
evidencePath?: string;
|
|
422
|
+
junitPath?: string;
|
|
423
|
+
}
|
|
424
|
+
interface DefinedTargetPackRun {
|
|
425
|
+
pack: TargetPack;
|
|
426
|
+
run(runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
427
|
+
}
|
|
428
|
+
declare function defineTargetPack(spec: TargetPackSpec): TargetPack;
|
|
429
|
+
declare function createTargetPackRegistry(packs: readonly TargetPack[]): ReadonlyMap<string, TargetPack>;
|
|
430
|
+
declare function doctorTargetPack(pack: TargetPack, env?: Record<string, string | undefined>, requiredChecks?: readonly string[]): TargetPackDoctorResult;
|
|
431
|
+
declare function defineTargetPackRun(pack: TargetPack, options?: RunTargetPackOptions): DefinedTargetPackRun;
|
|
432
|
+
declare function runTargetPack(pack: TargetPack, options?: RunTargetPackOptions, runtime?: LiveSuiteRuntime): Promise<LiveEvidence | undefined>;
|
|
433
|
+
|
|
434
|
+
declare function createSqlDeltaFoundationPack(): TargetPack;
|
|
435
|
+
declare function createLakeflowFoundationPack(): TargetPack;
|
|
436
|
+
declare function createJobsCodeFoundationPack(): TargetPack;
|
|
437
|
+
declare function createUnityStorageFoundationPack(): TargetPack;
|
|
438
|
+
declare function createAppsOperationalFoundationPack(): TargetPack;
|
|
439
|
+
declare function createFoundationTargetPacks(): readonly TargetPack[];
|
|
440
|
+
declare const foundationTargetPacks: readonly TargetPack[];
|
|
441
|
+
|
|
442
|
+
interface JobTaskDependency {
|
|
443
|
+
task_key: string;
|
|
444
|
+
outcome?: string;
|
|
445
|
+
}
|
|
446
|
+
interface JobTaskBase {
|
|
447
|
+
task_key: string;
|
|
448
|
+
depends_on?: JobTaskDependency[];
|
|
449
|
+
run_if?: 'ALL_SUCCESS' | 'AT_LEAST_ONE_SUCCESS' | 'NONE_FAILED' | 'ALL_DONE' | 'AT_LEAST_ONE_FAILED' | 'ALL_FAILED';
|
|
450
|
+
timeout_seconds?: number;
|
|
451
|
+
max_retries?: number;
|
|
452
|
+
min_retry_interval_millis?: number;
|
|
453
|
+
retry_on_timeout?: boolean;
|
|
454
|
+
existing_cluster_id?: string;
|
|
455
|
+
job_cluster_key?: string;
|
|
456
|
+
environment_key?: string;
|
|
457
|
+
}
|
|
458
|
+
interface NotebookJobTask extends JobTaskBase {
|
|
459
|
+
notebook_task: {
|
|
460
|
+
notebook_path: string;
|
|
461
|
+
base_parameters?: Record<string, string>;
|
|
462
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
interface PythonWheelJobTask extends JobTaskBase {
|
|
466
|
+
python_wheel_task: {
|
|
467
|
+
package_name: string;
|
|
468
|
+
entry_point: string;
|
|
469
|
+
parameters?: string[];
|
|
470
|
+
named_parameters?: Record<string, string>;
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
interface SparkJarJobTask extends JobTaskBase {
|
|
474
|
+
spark_jar_task: {
|
|
475
|
+
main_class_name: string;
|
|
476
|
+
parameters?: string[];
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
interface SparkPythonJobTask extends JobTaskBase {
|
|
480
|
+
spark_python_task: {
|
|
481
|
+
python_file: string;
|
|
482
|
+
parameters?: string[];
|
|
483
|
+
source?: 'WORKSPACE' | 'GIT';
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
interface SparkSubmitJobTask extends JobTaskBase {
|
|
487
|
+
spark_submit_task: {
|
|
488
|
+
parameters: string[];
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
interface PipelineJobTask extends JobTaskBase {
|
|
492
|
+
pipeline_task: {
|
|
493
|
+
pipeline_id: string;
|
|
494
|
+
full_refresh?: boolean;
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
interface SqlJobTask extends JobTaskBase {
|
|
498
|
+
sql_task: Record<string, unknown> & {
|
|
499
|
+
warehouse_id: string;
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
interface DbtJobTask extends JobTaskBase {
|
|
503
|
+
dbt_task: Record<string, unknown> & {
|
|
504
|
+
commands: string[];
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
interface RunJobTask extends JobTaskBase {
|
|
508
|
+
run_job_task: {
|
|
509
|
+
job_id: number;
|
|
510
|
+
job_parameters?: Record<string, string>;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
interface ConditionJobTask extends JobTaskBase {
|
|
514
|
+
condition_task: {
|
|
515
|
+
left: string;
|
|
516
|
+
op: 'EQUAL_TO' | 'NOT_EQUAL' | 'GREATER_THAN' | 'GREATER_THAN_OR_EQUAL' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL';
|
|
517
|
+
right: string;
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
interface ForEachJobTask extends JobTaskBase {
|
|
521
|
+
for_each_task: {
|
|
522
|
+
inputs: string;
|
|
523
|
+
concurrency?: number;
|
|
524
|
+
task: Exclude<DatabricksJobTask, ForEachJobTask>;
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
type DatabricksJobTask = NotebookJobTask | PythonWheelJobTask | SparkJarJobTask | SparkPythonJobTask | SparkSubmitJobTask | PipelineJobTask | SqlJobTask | DbtJobTask | RunJobTask | ConditionJobTask | ForEachJobTask;
|
|
528
|
+
interface JobsSubmitRequest {
|
|
529
|
+
run_name: string;
|
|
530
|
+
tasks: DatabricksJobTask[];
|
|
531
|
+
parameters?: Array<{
|
|
532
|
+
name: string;
|
|
533
|
+
default: string;
|
|
534
|
+
}>;
|
|
535
|
+
job_clusters?: Array<Record<string, unknown> & {
|
|
536
|
+
job_cluster_key: string;
|
|
537
|
+
}>;
|
|
538
|
+
environments?: Array<Record<string, unknown> & {
|
|
539
|
+
environment_key: string;
|
|
540
|
+
}>;
|
|
541
|
+
git_source?: Record<string, unknown>;
|
|
542
|
+
timeout_seconds?: number;
|
|
543
|
+
idempotency_token?: string;
|
|
544
|
+
}
|
|
545
|
+
interface JobTaskRunState {
|
|
546
|
+
taskKey: string;
|
|
547
|
+
runId?: number;
|
|
548
|
+
lifeCycleState: string;
|
|
549
|
+
resultState: string;
|
|
550
|
+
stateMessage?: string;
|
|
551
|
+
attemptNumber?: number;
|
|
552
|
+
}
|
|
553
|
+
interface JobOrchestrationRun {
|
|
554
|
+
runId: number;
|
|
555
|
+
lifeCycleState: string;
|
|
556
|
+
resultState: string;
|
|
557
|
+
tasks: JobTaskRunState[];
|
|
558
|
+
repairs: JobRepairRunState[];
|
|
559
|
+
raw: Record<string, unknown>;
|
|
560
|
+
}
|
|
561
|
+
interface JobRepairRunState {
|
|
562
|
+
repairId: number;
|
|
563
|
+
type: string;
|
|
564
|
+
lifeCycleState: string;
|
|
565
|
+
resultState: string;
|
|
566
|
+
taskRunIds: number[];
|
|
567
|
+
}
|
|
568
|
+
interface JobWaitOptions {
|
|
569
|
+
timeoutMs?: number;
|
|
570
|
+
pollIntervalMs?: number;
|
|
571
|
+
}
|
|
572
|
+
interface JobRepairOptions {
|
|
573
|
+
rerunTasks?: string[];
|
|
574
|
+
latestRepairId?: number;
|
|
575
|
+
rerunDependentTasks?: boolean;
|
|
576
|
+
}
|
|
577
|
+
interface JobOrchestrationLiveSpec {
|
|
578
|
+
request: JobsSubmitRequest;
|
|
579
|
+
expectedResult?: string;
|
|
580
|
+
expectedTasks?: Record<string, string>;
|
|
581
|
+
repairFailedTasks?: boolean;
|
|
582
|
+
cancellation?: {
|
|
583
|
+
request: JobsSubmitRequest;
|
|
584
|
+
expectedResult?: string;
|
|
585
|
+
};
|
|
586
|
+
}
|
|
587
|
+
declare class DatabricksJobsAdapter {
|
|
588
|
+
private readonly client;
|
|
589
|
+
constructor(client: WorkspaceClientLike);
|
|
590
|
+
submit(request: JobsSubmitRequest): Promise<number>;
|
|
591
|
+
get(runId: number): Promise<JobOrchestrationRun>;
|
|
592
|
+
wait(runId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
593
|
+
cancel(runId: number): Promise<void>;
|
|
594
|
+
waitUntilActive(runId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
595
|
+
repair(runId: number, options?: JobRepairOptions): Promise<number>;
|
|
596
|
+
waitForRepair(runId: number, repairId: number, options?: JobWaitOptions): Promise<JobOrchestrationRun>;
|
|
597
|
+
}
|
|
598
|
+
declare function validateJobGraph(tasks: readonly DatabricksJobTask[]): void;
|
|
599
|
+
declare function jobsOrchestrationCheck(): LiveCheck;
|
|
600
|
+
declare function parseJobOrchestrationLiveSpec(value: string): JobOrchestrationLiveSpec;
|
|
601
|
+
declare function normalizeJobRun(fallbackRunId: number, raw: Record<string, unknown>): JobOrchestrationRun;
|
|
602
|
+
|
|
603
|
+
declare function jobsCertificationCheck(): LiveCheck;
|
|
604
|
+
|
|
605
|
+
declare function createLakeflowJobsTargetPack(): TargetPack;
|
|
606
|
+
|
|
607
|
+
declare function createBuiltinTargetPacks(): readonly TargetPack[];
|
|
608
|
+
declare const builtinTargetPacks: readonly TargetPack[];
|
|
609
|
+
|
|
610
|
+
export { type AppHealthCheckOptions, type AutoLoaderCheckOptions, type ConditionJobTask, type CreateContextOptions, type DatabricksJobTask, DatabricksJobsAdapter, type DbtJobTask, type DefinedLiveSuite, type DefinedTargetPackRun, type DeltaColumnContract, type DuckDbConnectionLike, type DuckDbContextOptions, type EphemeralLakebaseBranch, type ExecutionContext, type ForEachJobTask, type JobOrchestrationLiveSpec, type JobOrchestrationRun, type JobRepairOptions, type JobRepairRunState, type JobTaskBase, type JobTaskDependency, type JobTaskRunState, type JobWaitOptions, type JobsSubmitRequest, type LakebaseBranchOptions, type LakebaseCheckOptions, type LakebaseControlClient, type LiveCheck, type LiveCheckContext, type LiveCheckResult, type LiveCheckStatus, type LiveEvidence, type LiveSuiteRuntime, type LiveSuiteSpec, type MockDatabricksClient, type NotebookJobTask, type PipelineJobTask, type PollOptions, type PythonWheelJobTask, type RecordedCall, type RunJobTask, type RunTargetPackOptions, type SecretRotationCheckOptions, type SparkJarJobTask, type SparkPythonJobTask, type SparkSubmitJobTask, type SqlJobTask, TableFixture, type TargetPack, type TargetPackDoctorCheck, type TargetPackDoctorRequirement, type TargetPackDoctorResult, type TargetPackEvidenceMetadata, type TargetPackMaturity, type TargetPackRequirement, type TargetPackSpec, type TestProfile, type VolumeIOCheckOptions, type WorkspaceClientLike, type WorkspaceContextOptions, appHealthCheck, assertDeltaContract, autoLoaderIngestionCheck, backupRestoreCheck, builtinTargetPacks, classicComputeCheck, compareToGolden, createAppsOperationalFoundationPack, createBuiltinTargetPacks, createClientFromEnv, createDuckDbContext, createEphemeralLakebaseBranch, createExecutionContext, createFoundationTargetPacks, createJobsCodeFoundationPack, createLakebaseTestProvider, createLakeflowFoundationPack, createLakeflowJobsTargetPack, createMockDatabricksClient, createSqlDeltaFoundationPack, createTargetPackRegistry, createUnityStorageFoundationPack, createWorkspaceContext, customLiveCheck, dbtBuildCheck, defineLiveSuite, defineTargetPack, defineTargetPackRun, deleteEphemeralLakebaseBranch, deleteVolumeFile, deltaContractCheck, doctorTargetPack, ensureVolumeDirectory, expectQueryToMatchGolden, expectTable, failureRecoveryCheck, foundationTargetPacks, jobRunCheck, jobsCertificationCheck, jobsOrchestrationCheck, lakebaseCredentialCheck, lakebaseRoundTripCheck, normalizeJobRun, normalizeRow, normalizeVolumeRoot, notebookSubmitCheck, parseJobOrchestrationLiveSpec, parseStatementRows, performanceBudgetCheck, pipelineRefreshCheck, renderJUnit, resolveLakebaseProject, resolveProfile, resolveTokenProvider, restrictedPrincipalCheck, rollbackCheck, runLiveSuite, runTargetPack, secretRotationCheck, secretScopeCheck, serverlessComputeCheck, sqlRoundTripCheck, toLakebaseBranchId, toNamedParameters, unityCatalogAccessCheck, uploadVolumeFile, validateJobGraph, volumeIOCheck, waitForPipelineUpdate };
|