@dataform/core 3.0.9 → 3.0.11

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/bundle.d.ts CHANGED
@@ -16,34 +16,6 @@ interface INamedConfig {
16
16
  type?: string;
17
17
  name?: string;
18
18
  }
19
- interface IActionConfig {
20
- tags?: string[];
21
- dependencies?: Resolvable | Resolvable[];
22
- disabled?: boolean;
23
- }
24
- interface ITargetableConfig {
25
- database?: string;
26
- schema?: string;
27
- }
28
- interface IDependenciesConfig {
29
- dependencies?: Resolvable | Resolvable[];
30
- hermetic?: boolean;
31
- dependOnDependencyAssertions?: boolean;
32
- }
33
- interface IDocumentableConfig {
34
- columns?: IColumnsDescriptor;
35
- description?: string;
36
- }
37
- interface IColumnsDescriptor {
38
- [name: string]: string | IRecordDescriptor;
39
- }
40
- interface IRecordDescriptor {
41
- description?: string;
42
- columns?: IColumnsDescriptor;
43
- displayName?: string;
44
- tags?: string | string[];
45
- bigqueryPolicyTags?: string | string[];
46
- }
47
19
  interface ITarget {
48
20
  database?: string;
49
21
  schema?: string;
@@ -1297,6 +1269,14 @@ namespace dataform {
1297
1269
  public static getTypeUrl(typeUrlPrefix?: string): string;
1298
1270
  }
1299
1271
 
1272
+ /** OnSchemaChange enum. */
1273
+ enum OnSchemaChange {
1274
+ IGNORE = 0,
1275
+ FAIL = 1,
1276
+ EXTEND = 2,
1277
+ SYNCHRONIZE = 3
1278
+ }
1279
+
1300
1280
  /** Properties of an IncrementalTableConfig. */
1301
1281
  interface IIncrementalTableConfig {
1302
1282
 
@@ -1368,6 +1348,9 @@ namespace dataform {
1368
1348
 
1369
1349
  /** IncrementalTableConfig hermetic */
1370
1350
  hermetic?: (boolean|null);
1351
+
1352
+ /** IncrementalTableConfig onSchemaChange */
1353
+ onSchemaChange?: (dataform.ActionConfig.OnSchemaChange|null);
1371
1354
  }
1372
1355
 
1373
1356
  /** Represents an IncrementalTableConfig. */
@@ -1448,6 +1431,9 @@ namespace dataform {
1448
1431
  /** IncrementalTableConfig hermetic. */
1449
1432
  public hermetic: boolean;
1450
1433
 
1434
+ /** IncrementalTableConfig onSchemaChange. */
1435
+ public onSchemaChange: dataform.ActionConfig.OnSchemaChange;
1436
+
1451
1437
  /**
1452
1438
  * Creates a new IncrementalTableConfig instance using the specified properties.
1453
1439
  * @param [properties] Properties to set
@@ -2239,6 +2225,9 @@ namespace dataform {
2239
2225
 
2240
2226
  /** NotebookRuntimeOptionsConfig outputBucket */
2241
2227
  outputBucket?: (string|null);
2228
+
2229
+ /** NotebookRuntimeOptionsConfig runtimeTemplateName */
2230
+ runtimeTemplateName?: (string|null);
2242
2231
  }
2243
2232
 
2244
2233
  /** Represents a NotebookRuntimeOptionsConfig. */
@@ -2253,6 +2242,9 @@ namespace dataform {
2253
2242
  /** NotebookRuntimeOptionsConfig outputBucket. */
2254
2243
  public outputBucket?: (string|null);
2255
2244
 
2245
+ /** NotebookRuntimeOptionsConfig runtimeTemplateName. */
2246
+ public runtimeTemplateName: string;
2247
+
2256
2248
  /** NotebookRuntimeOptionsConfig outputSink. */
2257
2249
  public outputSink?: "outputBucket";
2258
2250
 
@@ -3304,6 +3296,14 @@ namespace dataform {
3304
3296
  VIEW = 3
3305
3297
  }
3306
3298
 
3299
+ /** OnSchemaChange enum. */
3300
+ enum OnSchemaChange {
3301
+ IGNORE = 0,
3302
+ FAIL = 1,
3303
+ EXTEND = 2,
3304
+ SYNCHRONIZE = 3
3305
+ }
3306
+
3307
3307
  /** Properties of a Table. */
3308
3308
  interface ITable {
3309
3309
 
@@ -3352,6 +3352,9 @@ namespace dataform {
3352
3352
  /** Table uniqueKey */
3353
3353
  uniqueKey?: (string[]|null);
3354
3354
 
3355
+ /** Table onSchemaChange */
3356
+ onSchemaChange?: (dataform.OnSchemaChange|null);
3357
+
3355
3358
  /** Table preOps */
3356
3359
  preOps?: (string[]|null);
3357
3360
 
@@ -3425,6 +3428,9 @@ namespace dataform {
3425
3428
  /** Table uniqueKey. */
3426
3429
  public uniqueKey: string[];
3427
3430
 
3431
+ /** Table onSchemaChange. */
3432
+ public onSchemaChange: dataform.OnSchemaChange;
3433
+
3428
3434
  /** Table preOps. */
3429
3435
  public preOps: string[];
3430
3436
 
@@ -4198,6 +4204,9 @@ namespace dataform {
4198
4204
 
4199
4205
  /** NotebookRuntimeOptions outputBucket */
4200
4206
  outputBucket?: (string|null);
4207
+
4208
+ /** NotebookRuntimeOptions runtimeTemplateName */
4209
+ runtimeTemplateName?: (string|null);
4201
4210
  }
4202
4211
 
4203
4212
  /** Represents a NotebookRuntimeOptions. */
@@ -4212,6 +4221,9 @@ namespace dataform {
4212
4221
  /** NotebookRuntimeOptions outputBucket. */
4213
4222
  public outputBucket?: (string|null);
4214
4223
 
4224
+ /** NotebookRuntimeOptions runtimeTemplateName. */
4225
+ public runtimeTemplateName: string;
4226
+
4215
4227
  /** NotebookRuntimeOptions outputSink. */
4216
4228
  public outputSink?: "outputBucket";
4217
4229
 
@@ -7367,6 +7379,8 @@ declare class DataPreparation extends ActionBuilder<dataform.DataPreparation> {
7367
7379
  getFileName(): string;
7368
7380
  getTarget(): dataform.Target;
7369
7381
  compile(): dataform.DataPreparation;
7382
+ private resolveEmpty;
7383
+ private resolveTargets;
7370
7384
  private applySessionToDataPreparationContents;
7371
7385
  private applySessionToTableReference;
7372
7386
  private getTargets;
@@ -7384,100 +7398,15 @@ declare class Declaration extends ActionBuilder<dataform.Declaration> {
7384
7398
  private verifyConfig;
7385
7399
  }
7386
7400
 
7387
- declare const TableType: readonly ["table", "view", "incremental"];
7388
- declare type TableType = typeof TableType[number];
7389
- interface IBigQueryOptions {
7390
- partitionBy?: string;
7391
- clusterBy?: string[];
7392
- updatePartitionFilter?: string;
7393
- labels?: {
7394
- [name: string]: string;
7395
- };
7396
- partitionExpirationDays?: number;
7397
- requirePartitionFilter?: boolean;
7398
- additionalOptions?: {
7399
- [name: string]: string;
7400
- };
7401
- }
7402
- interface ITableAssertions {
7403
- uniqueKey?: string | string[];
7404
- uniqueKeys?: string[][];
7405
- nonNull?: string | string[];
7406
- rowConditions?: string[];
7407
- }
7408
- interface ITableConfig extends IActionConfig, IDependenciesConfig, IDocumentableConfig, INamedConfig, ITargetableConfig {
7409
- type?: TableType;
7410
- protected?: boolean;
7411
- bigquery?: IBigQueryOptions;
7412
- assertions?: ITableAssertions;
7413
- uniqueKey?: string[];
7414
- materialized?: boolean;
7415
- }
7416
- interface ITableContext extends ICommonContext {
7417
- when: (cond: boolean, trueCase: string, falseCase?: string) => string;
7418
- incremental: () => boolean;
7419
- }
7420
- declare class Table extends ActionBuilder<dataform.Table> {
7421
- proto: dataform.ITable;
7422
- session: Session;
7423
- dependOnDependencyAssertions: boolean;
7424
- contextableQuery: Contextable<ITableContext, string>;
7425
- private contextableWhere;
7426
- private contextablePreOps;
7427
- private contextablePostOps;
7428
- private uniqueKeyAssertions;
7429
- private rowConditionsAssertion;
7430
- constructor(session?: Session, tableTypeConfig?: dataform.ActionConfig.TableConfig | dataform.ActionConfig.ViewConfig | dataform.ActionConfig.IncrementalTableConfig, tableType?: TableType, configPath?: string);
7431
- config(config: ITableConfig): this;
7432
- type(type: TableType): this;
7433
- query(query: Contextable<ITableContext, string>): this;
7434
- where(where: Contextable<ITableContext, string>): this;
7435
- preOps(pres: Contextable<ITableContext, string | string[]>): this;
7436
- postOps(posts: Contextable<ITableContext, string | string[]>): this;
7437
- disabled(disabled?: boolean): this;
7438
- protected(defaultsToTrueProtected: boolean): this;
7439
- uniqueKey(uniqueKey: string[]): void;
7440
- materialized(materialized: boolean): void;
7441
- bigquery(bigquery: dataform.IBigQueryOptions): this;
7442
- dependencies(value: Resolvable | Resolvable[]): this;
7443
- hermetic(hermetic: boolean): void;
7444
- tags(value: string | string[]): this;
7445
- description(description: string): this;
7446
- columns(columns: IColumnsDescriptor): this;
7447
- database(database: string): this;
7448
- schema(schema: string): this;
7449
- assertions(assertions: ITableAssertions): this;
7450
- setDependOnDependencyAssertions(dependOnDependencyAssertions: boolean): this;
7451
- getFileName(): string;
7452
- getTarget(): dataform.Target;
7453
- compile(): dataform.Table;
7454
- private contextifyOps;
7455
- private legacyMapConfigAssertions;
7456
- }
7457
- declare class TableContext implements ITableContext {
7458
- private table;
7459
- private isIncremental;
7460
- constructor(table: Table, isIncremental?: boolean);
7461
- config(config: ITableConfig): string;
7462
- self(): string;
7463
- name(): string;
7464
- ref(ref: Resolvable | string[], ...rest: string[]): string;
7465
- resolve(ref: Resolvable | string[], ...rest: string[]): string;
7466
- schema(): string;
7467
- database(): string;
7468
- type(type: TableType): string;
7469
- where(where: Contextable<ITableContext, string>): string;
7470
- when(cond: boolean, trueCase: string, falseCase?: string): string;
7471
- incremental(): boolean;
7472
- preOps(statement: Contextable<ITableContext, string | string[]>): string;
7473
- postOps(statement: Contextable<ITableContext, string | string[]>): string;
7474
- disabled(): string;
7475
- bigquery(bigquery: dataform.IBigQueryOptions): string;
7476
- dependencies(res: Resolvable): string;
7477
- apply<T>(value: Contextable<ITableContext, T>): T;
7478
- tags(tags: string[]): string;
7401
+ interface ILegacyIncrementalTableConfig extends dataform.ActionConfig.IncrementalTableConfig {
7402
+ dependencies: Resolvable[];
7403
+ database: string;
7404
+ schema: string;
7405
+ fileName: string;
7406
+ type: string;
7407
+ bigquery?: ILegacyTableBigqueryConfig;
7408
+ assertions: any;
7479
7409
  }
7480
-
7481
7410
  declare class IncrementalTable extends ActionBuilder<dataform.Table> {
7482
7411
  proto: dataform.ITable;
7483
7412
  session: Session;
@@ -7494,7 +7423,7 @@ declare class IncrementalTable extends ActionBuilder<dataform.Table> {
7494
7423
  preOps(pres: Contextable<ITableContext, string | string[]>): this;
7495
7424
  postOps(posts: Contextable<ITableContext, string | string[]>): this;
7496
7425
  disabled(disabled?: boolean): this;
7497
- protected(defaultsToTrueProtected: boolean): this;
7426
+ protected(isProtected: boolean): this;
7498
7427
  uniqueKey(uniqueKey: string[]): void;
7499
7428
  bigquery(bigquery: dataform.IBigQueryOptions): this;
7500
7429
  dependencies(value: Resolvable | Resolvable[]): this;
@@ -7511,6 +7440,7 @@ declare class IncrementalTable extends ActionBuilder<dataform.Table> {
7511
7440
  compile(): dataform.Table;
7512
7441
  private contextifyOps;
7513
7442
  private verifyConfig;
7443
+ private mapOnSchemaChange;
7514
7444
  }
7515
7445
 
7516
7446
  declare class Notebook extends ActionBuilder<dataform.Notebook> {
@@ -7564,6 +7494,23 @@ declare class OperationContext implements ICommonContext {
7564
7494
  apply<T>(value: Contextable<ICommonContext, T>): T;
7565
7495
  }
7566
7496
 
7497
+ interface ILegacyViewBigqueryConfig {
7498
+ labels: {
7499
+ [key: string]: string;
7500
+ };
7501
+ additionalOptions: {
7502
+ [key: string]: string;
7503
+ };
7504
+ }
7505
+ interface ILegacyViewConfig extends dataform.ActionConfig.ViewConfig {
7506
+ dependencies: Resolvable[];
7507
+ database: string;
7508
+ schema: string;
7509
+ fileName: string;
7510
+ type: string;
7511
+ bigquery: ILegacyViewBigqueryConfig;
7512
+ assertions: any;
7513
+ }
7567
7514
  declare class View extends ActionBuilder<dataform.Table> {
7568
7515
  proto: dataform.ITable;
7569
7516
  session: Session;
@@ -7598,6 +7545,73 @@ declare class View extends ActionBuilder<dataform.Table> {
7598
7545
  private verifyConfig;
7599
7546
  }
7600
7547
 
7548
+ declare const TableType: readonly ["table", "view", "incremental"];
7549
+ declare type TableType = typeof TableType[number];
7550
+ interface ILegacyTableConfig extends dataform.ActionConfig.TableConfig {
7551
+ dependencies: Resolvable[];
7552
+ database: string;
7553
+ schema: string;
7554
+ fileName: string;
7555
+ type: string;
7556
+ bigquery?: ILegacyTableBigqueryConfig;
7557
+ assertions: any;
7558
+ }
7559
+ declare class Table extends ActionBuilder<dataform.Table> {
7560
+ proto: dataform.ITable;
7561
+ session: Session;
7562
+ dependOnDependencyAssertions: boolean;
7563
+ contextableQuery: Contextable<ITableContext, string>;
7564
+ private contextableWhere;
7565
+ private contextablePreOps;
7566
+ private contextablePostOps;
7567
+ private uniqueKeyAssertions;
7568
+ private rowConditionsAssertion;
7569
+ constructor(session?: Session, unverifiedConfig?: any, configPath?: string);
7570
+ type(type: TableType): this | View | IncrementalTable;
7571
+ query(query: Contextable<ITableContext, string>): this;
7572
+ where(where: Contextable<ITableContext, string>): this;
7573
+ preOps(pres: Contextable<ITableContext, string | string[]>): this;
7574
+ postOps(posts: Contextable<ITableContext, string | string[]>): this;
7575
+ disabled(disabled?: boolean): this;
7576
+ bigquery(bigquery: dataform.IBigQueryOptions): this;
7577
+ dependencies(value: Resolvable | Resolvable[]): this;
7578
+ hermetic(hermetic: boolean): void;
7579
+ tags(value: string | string[]): this;
7580
+ description(description: string): this;
7581
+ columns(columns: dataform.ActionConfig.ColumnDescriptor[]): this;
7582
+ database(database: string): this;
7583
+ schema(schema: string): this;
7584
+ assertions(assertions: dataform.ActionConfig.TableAssertionsConfig): this;
7585
+ setDependOnDependencyAssertions(dependOnDependencyAssertions: boolean): this;
7586
+ getFileName(): string;
7587
+ getTarget(): dataform.Target;
7588
+ compile(): dataform.Table;
7589
+ private contextifyOps;
7590
+ private verifyConfig;
7591
+ }
7592
+ declare class TableContext implements ITableContext {
7593
+ private table;
7594
+ private isIncremental;
7595
+ constructor(table: Table, isIncremental?: boolean);
7596
+ self(): string;
7597
+ name(): string;
7598
+ ref(ref: Resolvable | string[], ...rest: string[]): string;
7599
+ resolve(ref: Resolvable | string[], ...rest: string[]): string;
7600
+ schema(): string;
7601
+ database(): string;
7602
+ type(type: TableType): string;
7603
+ where(where: Contextable<ITableContext, string>): string;
7604
+ when(cond: boolean, trueCase: string, falseCase?: string): string;
7605
+ incremental(): boolean;
7606
+ preOps(statement: Contextable<ITableContext, string | string[]>): string;
7607
+ postOps(statement: Contextable<ITableContext, string | string[]>): string;
7608
+ disabled(): string;
7609
+ bigquery(bigquery: dataform.IBigQueryOptions): string;
7610
+ dependencies(res: Resolvable): string;
7611
+ apply<T>(value: Contextable<ITableContext, T>): T;
7612
+ tags(tags: string[]): string;
7613
+ }
7614
+
7601
7615
  declare type Action = Table | View | IncrementalTable | Operation | Assertion | Declaration | Notebook | DataPreparation;
7602
7616
  declare abstract class ActionBuilder<T> {
7603
7617
  session: Session;
@@ -7610,6 +7624,23 @@ declare abstract class ActionBuilder<T> {
7610
7624
  abstract compile(): T;
7611
7625
  private validateTarget;
7612
7626
  }
7627
+ interface ITableContext extends ICommonContext {
7628
+ when: (cond: boolean, trueCase: string, falseCase?: string) => string;
7629
+ incremental: () => boolean;
7630
+ }
7631
+ interface ILegacyTableBigqueryConfig {
7632
+ partitionBy?: string;
7633
+ clusterBy?: string[];
7634
+ updatePartitionFilter?: string;
7635
+ labels?: {
7636
+ [key: string]: string;
7637
+ };
7638
+ partitionExpirationDays?: number;
7639
+ requirePartitionFilter?: boolean;
7640
+ additionalOptions?: {
7641
+ [key: string]: string;
7642
+ };
7643
+ }
7613
7644
 
7614
7645
  interface IStringifier<T> {
7615
7646
  stringify: (value: T) => string;
@@ -7690,7 +7721,7 @@ declare class Session {
7690
7721
  }): void;
7691
7722
  resolve(ref: Resolvable | string[], ...rest: string[]): string;
7692
7723
  operate(name: string, queries?: Contextable<ICommonContext, string | string[]>): Operation;
7693
- publish(name: string, queryOrConfig?: Contextable<ITableContext, string> | ITableConfig): Table;
7724
+ publish(name: string, queryOrConfig?: Contextable<ITableContext, string> | ILegacyTableConfig | ILegacyViewConfig | ILegacyIncrementalTableConfig): Table | IncrementalTable | View;
7694
7725
  assert(name: string, query?: AContextable<string>): Assertion;
7695
7726
  declare(dataset: dataform.ITarget): Declaration;
7696
7727
  test(name: string): Test;
@@ -7724,7 +7755,7 @@ declare class ActionMap {
7724
7755
  private setBySchemaLevel;
7725
7756
  }
7726
7757
 
7727
- declare const version = "3.0.9";
7758
+ declare const version = "3.0.11";
7728
7759
 
7729
7760
  declare const session: Session;
7730
7761
  declare const supportedFeatures: dataform.SupportedFeatures[];