Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ts_test_suite(
"jit_context_test.ts",
"main_test.ts",
"utils_test.ts",
"workflow_settings_test.ts",
],
data = [
":node_modules",
Expand Down
3 changes: 3 additions & 0 deletions core/workflow_settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ export function workflowSettingsAsProjectConfig(
if (workflowSettings.preserveGovernanceControls) {
projectConfig.preserveGovernanceControls = workflowSettings.preserveGovernanceControls;
}
if (workflowSettings.lineage) {
projectConfig.lineage = workflowSettings.lineage;
}
projectConfig.warehouse = "bigquery";
return projectConfig;
}
25 changes: 25 additions & 0 deletions core/workflow_settings_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { expect } from "chai";

import { workflowSettingsAsProjectConfig } from "df/core/workflow_settings";
import { dataform } from "df/protos/ts";
import { suite, test } from "df/testing";

suite("workflowSettingsAsProjectConfig", () => {
test("copies lineage settings when set", () => {
const workflowSettings = dataform.WorkflowSettings.create({
lineage: { enabled: true },
});

const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);

expect(projectConfig.lineage).to.deep.equal({ enabled: true });
});

test("leaves lineage unset when workflow settings omit it", () => {
const workflowSettings = dataform.WorkflowSettings.create({});

const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);

expect(projectConfig.lineage).to.equal(null);
});
});
9 changes: 9 additions & 0 deletions protos/configs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ message WorkflowSettings {
// Optional. If set to true, governance controls (e.g. Data Policies) will be
// preserved on BigQuery tables.
bool preserve_governance_controls = 18;

// Optional. Configuration for Knowledge Catalog lineage emission.
LineageSettings lineage = 19;
}

message LineageSettings {
// If true, emit OpenLineage events to Knowledge Catalog
// (datalineage.googleapis.com) after each Dataform action completes.
bool enabled = 1;
}

// Action configs defines the contents of `actions.yaml` configuration files.
Expand Down
2 changes: 2 additions & 0 deletions protos/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ message ProjectConfig {

bool preserve_governance_controls = 24;

LineageSettings lineage = 25;

reserved 3, 4, 6, 8, 10, 12, 13;
}

Expand Down
Loading