diff --git a/protos/configs.proto b/protos/configs.proto index eab2d421b..1d717afe1 100644 --- a/protos/configs.proto +++ b/protos/configs.proto @@ -75,6 +75,26 @@ message WorkflowSettings { // Optional. Configuration for Knowledge Catalog lineage emission. LineageSettings lineage = 19; + + // Optional. Default key-value pairs for BigQuery job labels applied to + // BigQuery jobs executed for supported actions in this project (tables, + // views, incremental tables, assertions, operations, data preparations, + // property graphs, and unit tests). Action-level `jobLabels` override + // matching keys from `defaultJobLabels`, but cannot remove a default key. + // + // Validation rules (stricter than BigQuery's general label rules, which allow + // up to 64 labels and international characters): + // - Keys and values may contain only lowercase ASCII letters (`a-z`), digits + // (`0-9`), underscores (`_`), and hyphens (`-`). + // - Keys must be 1-63 characters and start with a lowercase letter. Values + // must be 0-63 characters. + // - At most 32 labels per action after merging `defaultJobLabels` and + // action-level `jobLabels`. + // - Keys starting with reserved prefixes (`dataform_`, `dataform-`, + // `dataprep-`, `gcp-`, `goog-`) or matching reserved keys + // (`bigquery-workflow`, `single-file-asset-type`, `origin`, `bq-dea`, + // `data-preparation-file-loader`) are rejected. + map default_job_labels = 20; } // Configuration for Knowledge Catalog lineage emission. @@ -281,6 +301,11 @@ message ActionConfig { // Optional. If true, preserves existing BigQuery column governance controls // (e.g. data policy) when recreating a table. optional bool preserve_governance_controls = 25; + + // Optional. Key-value pairs for BigQuery job labels applied to the query + // job(s) executed for this table. Overrides matching keys from + // `default_job_labels` in `workflow_settings.yaml`. + map job_labels = 26; } message Metadata { @@ -369,6 +394,11 @@ message ActionConfig { // If unset, the value from workflow_settings.yaml is used. If neither is set, default BigQuery behavior applies. // Dataform CLI only (GCP Dataform support pending). string reservation = 21; + + // Optional. Key-value pairs for BigQuery job labels applied to the query + // job(s) executed for this view. Overrides matching keys from + // `default_job_labels` in `workflow_settings.yaml`. + map job_labels = 22; } enum OnSchemaChange { @@ -508,6 +538,11 @@ message ActionConfig { // Optional. If true, preserves existing BigQuery column governance controls // (e.g. data policy) when recreating a table. optional bool preserve_governance_controls = 30; + + // Optional. Key-value pairs for BigQuery job labels applied to the query + // job(s) executed for this incremental table. Overrides matching keys from + // `default_job_labels` in `workflow_settings.yaml`. + map job_labels = 31; } message AssertionConfig { @@ -554,6 +589,11 @@ message ActionConfig { // Metadata for this assertion. Metadata metadata = 12; + + // Optional. Key-value pairs for BigQuery job labels applied to the query + // job(s) executed for this assertion. Overrides matching keys from + // `default_job_labels` in `workflow_settings.yaml`. + map job_labels = 13; } message OperationConfig { @@ -606,6 +646,11 @@ message ActionConfig { // If unset, the value from workflow_settings.yaml is used. If neither is set, default BigQuery behavior applies. // Dataform CLI only (GCP Dataform support pending). string reservation = 13; + + // Optional. Key-value pairs for BigQuery job labels applied to the query + // job(s) executed for this operation. Overrides matching keys from + // `default_job_labels` in `workflow_settings.yaml`. + map job_labels = 14; } message DeclarationConfig { @@ -697,6 +742,11 @@ message ActionConfig { LoadModeConfig load_mode = 12; + // Optional. Key-value pairs for BigQuery job labels applied to the BigQuery + // job(s) executed for this data preparation. Overrides matching keys from + // `default_job_labels` in `workflow_settings.yaml`. + map job_labels = 15; + message ErrorTableConfig { // The name of the error table. string name = 1; diff --git a/protos/core.proto b/protos/core.proto index 3f56518d3..81f19dcbc 100644 --- a/protos/core.proto +++ b/protos/core.proto @@ -42,6 +42,8 @@ message ProjectConfig { optional bool lineage_enabled = 25; + map default_job_labels = 26; + reserved 3, 4, 6, 8, 10, 12, 13; } @@ -153,6 +155,10 @@ message ActionDescriptor { Metadata metadata = 4; ActionCompilationMode compilation_mode = 5; string reservation = 6; + // Effective BigQuery job labels for this action, with + // `ProjectConfig.default_job_labels` already merged in and overridden by + // action-level `job_labels`. + map job_labels = 7; } message Metadata { @@ -345,6 +351,8 @@ message Test { Target canonical_target = 8; repeated Target dependency_targets = 9; + + ActionDescriptor action_descriptor = 11; } message Notebook { @@ -414,6 +422,8 @@ message DataPreparation { LoadConfiguration load = 16; + ActionDescriptor action_descriptor = 17; + reserved 7, 10; } @@ -449,6 +459,7 @@ message PropertyGraph { string graph_body = 8; bool disabled = 9; repeated string tags = 10; + ActionDescriptor action_descriptor = 11; } message GraphEntity { diff --git a/protos/property_graph_config.proto b/protos/property_graph_config.proto index 81ff2b685..fd4931248 100644 --- a/protos/property_graph_config.proto +++ b/protos/property_graph_config.proto @@ -17,6 +17,10 @@ message PropertyGraphConfig { bool disabled = 6; bool depend_on_dependency_assertions = 7; repeated string tags = 8; + // Optional. Key-value pairs for BigQuery job labels applied to the query + // job(s) executed for this property graph. Overrides matching keys from + // `default_job_labels` in `workflow_settings.yaml`. + map job_labels = 9; message TargetDataset { string project_id = 1;