Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync original #1

Merged
merged 63 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
0a9cc9b
Bump version to 3.0.0 (#1744)
Ekrekr Jun 21, 2024
41e05de
Enable File-Specific Formatting in dataform format (#1754)
hiracky16 Jun 21, 2024
c91ec38
Assertions configs as protos (#1731)
Ekrekr Jun 24, 2024
4e13354
Fix vscode extension crashes on windows (#1751)
moker-spaghetti Jun 24, 2024
0634d3a
Update the version of the vscode extension (#1759)
GJMcGowan Jun 25, 2024
e9238a4
Fix empty object internal error (#1763)
Ekrekr Jun 26, 2024
b787f18
Split table tests (#1761)
Ekrekr Jun 26, 2024
c52cabb
Fix protected default, add a unit test for SQLX config parameters (#1…
Ekrekr Jun 26, 2024
9698b76
Declaration configs as protos (#1767)
Ekrekr Jun 26, 2024
da1d7bd
Add support for action configs table assertions and hermeticity, add …
Ekrekr Jun 27, 2024
3614c9e
Rethrow useful errors when reading workflow_settings.yaml (#1772)
Ekrekr Jun 28, 2024
b3638a8
View config as protos, via a new class (#1760)
Ekrekr Jun 28, 2024
461faf8
Incremental tables as protos, via a new class (#1773)
Ekrekr Jul 7, 2024
f2f6f88
Operation config as protos (#1766)
Ekrekr Jul 7, 2024
b322655
Fix vscode ref issue #1768 (#1769)
moker-spaghetti Jul 8, 2024
4015b05
Add workflow_settings.yaml validation/completion VSCode extension (#1…
moker-spaghetti Jul 8, 2024
d3d0194
fix: dry run of assertions failing (#1778)
ashish10alex Jul 8, 2024
cd61c3e
feat: vscode extension, more intutive compile errors (#1775)
ashish10alex Jul 9, 2024
97123fa
Update vscode version to incorporate recent changes (#1784)
GJMcGowan Jul 9, 2024
6635abc
Added proto definitions for Data Preparations (#1788)
fernst Jul 18, 2024
85f47d4
Handling for Data Preparation actions (#1789)
fernst Jul 29, 2024
2469634
support building on arm mac, linux environments (#1790)
bmagyarkuti Jul 30, 2024
c4fc417
fix(1781): go to definition when namePrefix is specified in workflow_…
ashish10alex Jul 30, 2024
1ef847f
Fix vscode server linting (#1797)
Ekrekr Aug 5, 2024
9959bcb
Make the stateless CLI package installation error clearer (#1795)
Ekrekr Aug 5, 2024
8dcccd8
Regenerate configs reference with camelCase fields (#1796)
Ekrekr Aug 7, 2024
1c188e4
Fix notebook dependency targets (#1792)
Ekrekr Aug 7, 2024
e5316d5
Bumped version to 3.0.1 (#1798)
fernst Aug 7, 2024
a918c0c
Remove some outdated configs references, fix generated formatting (#1…
Ekrekr Aug 7, 2024
54dfa9c
Fix catchall errors (#1802)
Ekrekr Aug 8, 2024
dc5a001
Update WORKSPACE (#1512)
a2wd Aug 15, 2024
ae85965
Refresh test credentials (#1810)
Ekrekr Aug 15, 2024
2531b12
Update output for Data Preparation processing (#1808)
fernst Aug 15, 2024
7f69306
Sync proto structure and message names for data preparation. (#1811)
fernst Aug 16, 2024
bd7d6fb
Temporarily disable docs script during publish (#1817)
Ekrekr Aug 22, 2024
674b1e6
Added support for compilation overrides in Data Preparations (#1818)
fernst Sep 4, 2024
1868d37
Bump dataprep proto to latest config (#1825)
Ekrekr Sep 4, 2024
104c840
fix: vscode extension crash on windows due to *.cmd spawn (#1814)
moker-spaghetti Sep 5, 2024
b309aa0
Update unit test's result messages (#1812)
spider-man-tm Sep 5, 2024
1f48a0e
Restore ability to unit test views (#1824)
bmagyarkuti Sep 5, 2024
4b71bbf
Bump elliptic from 6.5.4 to 6.5.7 (#1831)
dependabot[bot] Sep 5, 2024
4d20929
fix: dry run fails when table/view/assertion already does not exsist …
ashish10alex Sep 5, 2024
bb36a53
Revert "fix: dry run fails when table/view/assertion already does not…
Ekrekr Sep 9, 2024
86254eb
Update Data Preparation processor to remove proto dependency. (#1839)
fernst Sep 11, 2024
840bb5b
MOSS Cap1 (#1833)
Tuseeq1 Sep 13, 2024
05341b7
Correct permission and branch name (#1845)
Tuseeq1 Sep 14, 2024
bb061c4
Remove cloudbuild.yaml (#1847)
Tuseeq1 Sep 16, 2024
f36a513
Make published packages include the version.bzl file (#1848)
Ekrekr Sep 17, 2024
09f606a
Remove data preparation proto definition. (#1849)
fernst Sep 19, 2024
338262b
Update the npm package version (#1852)
Tuseeq1 Sep 30, 2024
83afdbe
Branch name from master to main (#1853)
Tuseeq1 Sep 30, 2024
cb4cec4
Local test fix with npm install on cloudbuild (#1850)
Tuseeq1 Sep 30, 2024
00462d7
Fixing the name for automaticallty created PR (#1856)
Tuseeq1 Oct 1, 2024
cf9bfee
Update the npm package version (#1855)
Tuseeq1 Oct 1, 2024
6fcdab1
Creating release notes as part of publishing process (#1857)
Tuseeq1 Oct 4, 2024
5f1b9a0
fix `uniqueKey` assertions for views, incremental_tables (#1836)
bmagyarkuti Oct 7, 2024
9b6a2ce
Bump version to 3.5 to rollup uniquekeys fix (#1858)
Ekrekr Oct 11, 2024
ecd62d0
Bump the patch version to 3.0.6 (#1859)
Tuseeq1 Oct 14, 2024
fcfd46e
Change variable name in cloudbuild.yaml (#1860)
Tuseeq1 Oct 14, 2024
e16717f
Bump the pacth version (#1861)
Tuseeq1 Oct 15, 2024
136a990
Added logic to fully resolve targets (with prefixes/suffixes) when up…
fernst Nov 1, 2024
031fb9b
Update the npm package version (#1867)
Tuseeq1 Nov 4, 2024
0dff7a8
Bump rollup from 2.8.0 to 2.79.2 (#1854)
dependabot[bot] Nov 5, 2024
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
Prev Previous commit
Next Next commit
Fix notebook dependency targets (dataform-co#1792)
* Add better tests, fix proto conversion from config to compiled graph

* Tidy, fix some tests

* Extract target conversion for pure targets and action configs to separate functions, to fix include on dependency assertions

* Tidy

* Fix lint

* Force check retry
  • Loading branch information
Ekrekr authored Aug 7, 2024
commit 1c188e43d0d45508bd6860a2b909c0e1128219f8
3 changes: 2 additions & 1 deletion core/actions/assertion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as Path from "df/core/path";
import { Session } from "df/core/session";
import {
actionConfigToCompiledGraphTarget,
configTargetToCompiledGraphTarget,
nativeRequire,
resolvableAsTarget,
resolveActionsConfigFilename,
Expand Down Expand Up @@ -78,7 +79,7 @@ export class Assertion extends ActionBuilder<dataform.Assertion> {
if (config.dependencyTargets) {
this.dependencies(
config.dependencyTargets.map(dependencyTarget =>
actionConfigToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
)
);
}
Expand Down
54 changes: 30 additions & 24 deletions core/actions/data_preparation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Resolvable } from "df/core/common";
import * as Path from "df/core/path";
import { Session } from "df/core/session";
import {
actionConfigToCompiledGraphTarget,
addDependenciesToActionDependencyTargets,
configTargetToCompiledGraphTarget,
nativeRequire,
resolveActionsConfigFilename
} from "df/core/utils";
Expand Down Expand Up @@ -37,22 +39,27 @@ export class DataPreparation extends ActionBuilder<dataform.DataPreparation> {
this.proto.dataPreparation = dataPreparationDefinition;

// Find targets
const targets = getTargets(dataPreparationDefinition)
this.proto.targets = targets.map((target) => this.applySessionToTarget(
target,
session.projectConfig,
config.filename,
true
));
this.proto.canonicalTargets = targets.map((target) => this.applySessionToTarget(target, session.canonicalProjectConfig));
const targets = getTargets(dataPreparationDefinition);
this.proto.targets = targets.map(target =>
this.applySessionToTarget(target, session.projectConfig, config.filename, true)
);
this.proto.canonicalTargets = targets.map(target =>
this.applySessionToTarget(target, session.canonicalProjectConfig)
);

// Set the unique target key as the first target defined.
// TODO: Remove once multiple targets are supported.
this.proto.target = this.proto.targets[0];
this.proto.canonicalTarget = this.proto.canonicalTargets[0];

this.proto.tags = config.tags;
this.dependencies(config.dependencyTargets);
if (config.dependencyTargets) {
this.dependencies(
config.dependencyTargets.map(dependencyTarget =>
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
)
);
}
this.proto.fileName = config.filename;
if (config.disabled) {
this.proto.disabled = config.disabled;
Expand All @@ -72,7 +79,7 @@ export class DataPreparation extends ActionBuilder<dataform.DataPreparation> {
public dependencies(value: Resolvable | Resolvable[]) {
const newDependencies = Array.isArray(value) ? value : [value];
newDependencies.forEach(resolvable =>
addDependenciesToActionDependencyTargets(this, resolvable)
addDependenciesToActionDependencyTargets(this, resolvable)
);
return this;
}
Expand Down Expand Up @@ -101,17 +108,18 @@ export class DataPreparation extends ActionBuilder<dataform.DataPreparation> {
}
}

function parseDataPreparationDefinitionJson(
dataPreparationAsJson: { [key: string]: unknown }): dataform.DataPreparationDefinition {
function parseDataPreparationDefinitionJson(dataPreparationAsJson: {
[key: string]: unknown;
}): dataform.DataPreparationDefinition {
try {
return dataform.DataPreparationDefinition.create(
verifyObjectMatchesProto(
dataform.DataPreparationDefinition,
dataPreparationAsJson as {
[key: string]: any;
},
VerifyProtoErrorBehaviour.SHOW_DOCS_LINK
)
verifyObjectMatchesProto(
dataform.DataPreparationDefinition,
dataPreparationAsJson as {
[key: string]: any;
},
VerifyProtoErrorBehaviour.SHOW_DOCS_LINK
)
);
} catch (e) {
if (e instanceof ReferenceError) {
Expand All @@ -121,20 +129,18 @@ function parseDataPreparationDefinitionJson(
}
}

function getTargets(
definition: dataform.DataPreparationDefinition
): dataform.Target[] {
function getTargets(definition: dataform.DataPreparationDefinition): dataform.Target[] {
const targets: dataform.Target[] = [];

definition.nodes.forEach(node => {
const table = node.destination?.table;
if (table) {
const compiledGraphTarget: dataform.ITarget = {
database: table.project,
schema:table.dataset,
schema: table.dataset,
name: table.table
};
targets.push(dataform.Target.create(compiledGraphTarget))
targets.push(dataform.Target.create(compiledGraphTarget));
}
});

Expand Down
7 changes: 6 additions & 1 deletion core/actions/incremental_table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Session } from "df/core/session";
import {
actionConfigToCompiledGraphTarget,
addDependenciesToActionDependencyTargets,
configTargetToCompiledGraphTarget,
nativeRequire,
resolvableAsTarget,
resolveActionsConfigFilename,
Expand Down Expand Up @@ -104,7 +105,11 @@ export class IncrementalTable extends ActionBuilder<dataform.Table> {
this.setDependOnDependencyAssertions(config.dependOnDependencyAssertions);
}
if (config.dependencyTargets) {
this.dependencies(config.dependencyTargets);
this.dependencies(
config.dependencyTargets.map(dependencyTarget =>
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
)
);
}
if (config.hermetic !== undefined) {
this.hermetic(config.hermetic);
Expand Down
9 changes: 8 additions & 1 deletion core/actions/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Session } from "df/core/session";
import {
actionConfigToCompiledGraphTarget,
addDependenciesToActionDependencyTargets,
configTargetToCompiledGraphTarget,
nativeRequire,
resolveActionsConfigFilename
} from "df/core/utils";
Expand Down Expand Up @@ -46,7 +47,13 @@ export class Notebook extends ActionBuilder<dataform.Notebook> {
this.proto.canonicalTarget = this.applySessionToTarget(target, session.canonicalProjectConfig);
this.proto.tags = config.tags;
this.dependOnDependencyAssertions = config.dependOnDependencyAssertions;
this.dependencies(config.dependencyTargets);
if (config.dependencyTargets) {
this.dependencies(
config.dependencyTargets.map(dependencyTarget =>
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
)
);
}
this.proto.fileName = config.filename;
if (config.disabled) {
this.proto.disabled = config.disabled;
Expand Down
3 changes: 2 additions & 1 deletion core/actions/operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Session } from "df/core/session";
import {
actionConfigToCompiledGraphTarget,
addDependenciesToActionDependencyTargets,
configTargetToCompiledGraphTarget,
nativeRequire,
resolvableAsTarget,
resolveActionsConfigFilename,
Expand Down Expand Up @@ -77,7 +78,7 @@ export class Operation extends ActionBuilder<dataform.Operation> {
if (config.dependencyTargets) {
this.dependencies(
config.dependencyTargets.map(dependencyTarget =>
actionConfigToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
)
);
}
Expand Down
7 changes: 4 additions & 3 deletions core/actions/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
actionConfigToCompiledGraphTarget,
addDependenciesToActionDependencyTargets,
checkExcessProperties,
configTargetToCompiledGraphTarget,
nativeRequire,
resolvableAsTarget,
resolveActionsConfigFilename,
Expand Down Expand Up @@ -345,7 +346,7 @@ export class Table extends ActionBuilder<dataform.Table> {
this.config({
type: "table",
dependencies: config.dependencyTargets.map(dependencyTarget =>
actionConfigToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
),
tags: config.tags,
disabled: config.disabled,
Expand Down Expand Up @@ -377,7 +378,7 @@ export class Table extends ActionBuilder<dataform.Table> {
this.config({
type: "view",
dependencies: config.dependencyTargets.map(dependencyTarget =>
actionConfigToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
),
disabled: config.disabled,
materialized: config.materialized,
Expand Down Expand Up @@ -431,7 +432,7 @@ export class Table extends ActionBuilder<dataform.Table> {
this.config({
type: "incremental",
dependencies: config.dependencyTargets.map(dependencyTarget =>
actionConfigToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
),
disabled: config.disabled,
protected: config.protected,
Expand Down
7 changes: 6 additions & 1 deletion core/actions/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Session } from "df/core/session";
import {
actionConfigToCompiledGraphTarget,
addDependenciesToActionDependencyTargets,
configTargetToCompiledGraphTarget,
nativeRequire,
resolvableAsTarget,
resolveActionsConfigFilename,
Expand Down Expand Up @@ -96,7 +97,11 @@ export class View extends ActionBuilder<dataform.Table> {
this.setDependOnDependencyAssertions(config.dependOnDependencyAssertions);
}
if (config.dependencyTargets) {
this.dependencies(config.dependencyTargets);
this.dependencies(
config.dependencyTargets.map(dependencyTarget =>
configTargetToCompiledGraphTarget(dataform.ActionConfig.Target.create(dependencyTarget))
)
);
}
if (config.hermetic !== undefined) {
this.hermetic(config.hermetic);
Expand Down
Loading