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.lineageEnabled = workflowSettings.lineage.enabled;
}
projectConfig.warehouse = "bigquery";
return projectConfig;
}
35 changes: 35 additions & 0 deletions core/workflow_settings_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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("sets lineageEnabled when workflow settings enable lineage", () => {
const workflowSettings = dataform.WorkflowSettings.create({
lineage: { enabled: true },
});

const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);

expect(projectConfig.lineageEnabled).to.equal(true);
});

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

const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);

expect(projectConfig.lineageEnabled).to.equal(null);
});

test("sets lineageEnabled to false when lineage.enabled is explicitly false", () => {
const workflowSettings = dataform.WorkflowSettings.create({
lineage: { enabled: false },
});

const projectConfig = workflowSettingsAsProjectConfig(workflowSettings);

expect(projectConfig.lineageEnabled).to.equal(false);
});
});
10 changes: 10 additions & 0 deletions protos/configs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ 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;
}

// Configuration for Knowledge Catalog lineage emission.
message LineageSettings {
// If true, downstream runners will emit OpenLineage events to Knowledge
// Catalog for actions executed from this project.
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;

optional bool lineage_enabled = 25;

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

Expand Down
Loading