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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## [0.83.3]
- Synced the materialization strategy options with the Bruin CLI: added `time_interval` and the Data Vault strategies (`datavault_hub`, `datavault_link`, `datavault_satellite`) for SQL assets, accepted `replace` as an alias for `create+replace`, and updated the ingestr strategy set to add `scd2` and drop the removed `truncate+insert`.

## [0.83.2]
- Switching assets updates the SQL editor and lineage in place instead of reloading.

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ After installing, run the **Bruin: Show Getting Started Walkthrough** command fr
## Release Notes

### Recent Update
- **0.83.3**: Synced the materialization strategy options with the Bruin CLI — added `time_interval` and the Data Vault strategies (`datavault_hub`, `datavault_link`, `datavault_satellite`) for SQL assets, accepted `replace` as an alias for `create+replace`, and updated the ingestr strategy set to add `scd2` and drop the removed `truncate+insert`.
- **0.83.2**: Switching assets updates the SQL editor and lineage in place instead of reloading.
- **0.83.1**: Preview Dashboard offers to install or update `dac` when it's missing or below the required version.
- **0.83.0**: Added a Dashboards-as-Code preview — open a dashboard YAML and click the Preview Dashboard button in the editor toolbar to render it in a theme-matched webview backed by `dac serve`, with live reload on edit and an Open-in-Browser button.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "bruin",
"displayName": "Bruin",
"description": "Manage your Bruin data assets from within VS Code.",
"version": "0.83.2",
"version": "0.83.3",
"dacFrontend": {
"repo": "bruin-data/dac",
"version": "v0.7.0",
Expand Down
40 changes: 37 additions & 3 deletions schemas/yaml-assets-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
"merge",
"replace",
"append",
"scd2"
"scd2",
"none"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 none is not preserved

When an asset contains incremental_strategy: none, the ingestr editor has no matching option and displays a blank selection; choosing its empty-valued “None” option then removes the field from the saved parameters instead of preserving the valid literal.

Rule Used: What: Comments should be concise and targeted to s... (source)

Knowledge Base Used: Webview UI (Vue Frontend)

Prompt To Fix With AI
This is a comment left during a code review.
Path: schemas/yaml-assets-schema.json
Line: 221

Comment:
**`none` is not preserved**

When an asset contains `incremental_strategy: none`, the ingestr editor has no matching option and displays a blank selection; choosing its empty-valued “None” option then removes the field from the saved parameters instead of preserving the valid literal.

**Rule Used:** What: Comments should be concise and targeted to s... ([source](https://app.greptile.com/bruin/-/custom-context?memory=6adfbd2b-1b23-4560-9e00-6254e7cb7c70))

**Knowledge Base Used:** [Webview UI (Vue Frontend)](https://app.greptile.com/bruin/-/custom-context/knowledge-base/bruin-data/bruin-vscode/-/docs/webview-ui.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Conductor

]
},
"incremental_key": {
Expand Down Expand Up @@ -361,6 +362,34 @@
"then": {
"required": ["parameters"]
}
},
{
"if": {
"properties": {
"type": { "const": "ingestr" }
},
"required": ["type"]
},
"then": {
"properties": {
"materialization": {
"properties": {
"strategy": {
"enum": [
"create+replace",
"replace",
"delete+insert",
"append",
"merge",
"scd2_by_time",
"scd2_by_column"
],
"description": "For ingestr assets, materialization.strategy uses Bruin strategy names. create+replace (or its alias replace) maps to ingestr's \"replace\"; scd2_by_time/scd2_by_column map to ingestr's \"scd2\". Valid: create+replace, replace, delete+insert, append, merge, scd2_by_time, scd2_by_column."
}
}
}
}
}
}
]
},
Expand Down Expand Up @@ -500,13 +529,18 @@
"type": "string",
"enum": [
"create+replace",
"replace",
"delete+insert",
"truncate+insert",
"append",
"merge",
"time_interval",
"ddl",
"truncate+insert",
"scd2_by_time",
"scd2_by_column",
"scd2_by_time"
"datavault_hub",
"datavault_link",
"datavault_satellite"
],
"description": "Materialization strategy"
},
Expand Down
21 changes: 18 additions & 3 deletions src/language-server/providers/materializationCompletions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class MaterializationCompletions {
{
name: 'table',
description: 'Materialize as a table - requires strategy',
insertText: new vscode.SnippetString('table\n strategy: ${1|create+replace,delete+insert,merge,append,truncate+insert,ddl,scd2_by_column,scd2_by_time|}')
insertText: new vscode.SnippetString('table\n strategy: ${1|create+replace,delete+insert,truncate+insert,append,merge,time_interval,ddl,scd2_by_time,scd2_by_column,datavault_hub,datavault_link,datavault_satellite|}')
},
{
name: 'view',
Expand Down Expand Up @@ -344,10 +344,25 @@ export class MaterializationCompletions {
description: 'SCD2 by column',
requiresIncrementalKey: true
},
{
name: 'scd2_by_time',
{
name: 'scd2_by_time',
description: 'SCD2 by time (requires incremental_key)',
requiresIncrementalKey: true
},
{
name: 'datavault_hub',
description: 'Data Vault hub table (business keys)',
requiresIncrementalKey: false
},
{
name: 'datavault_link',
description: 'Data Vault link table (relationships between hubs)',
requiresIncrementalKey: false
},
{
name: 'datavault_satellite',
description: 'Data Vault satellite table (descriptive/historical attributes)',
requiresIncrementalKey: false
}
];

Expand Down
3 changes: 2 additions & 1 deletion webview-ui/src/components/asset/IngestrAssetDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ const INCREMENTAL_STRATEGIES = [
{ value: 'replace', label: 'Replace' },
{ value: 'append', label: 'Append' },
{ value: 'merge', label: 'Merge' },
{ value: 'delete+insert', label: 'Delete + Insert' }
{ value: 'delete+insert', label: 'Delete + Insert' },
{ value: 'scd2', label: 'SCD2' }
] as const;

import assetsSchema from '../../../../schemas/yaml-assets-schema.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,15 @@ const allStrategyOptions = [
{ value: "ddl", label: "DDL" },
{ value: "scd2_by_time", label: "SCD2 by Time" },
{ value: "scd2_by_column", label: "SCD2 by Column" },
{ value: "datavault_hub", label: "Data Vault Hub" },
{ value: "datavault_link", label: "Data Vault Link" },
{ value: "datavault_satellite", label: "Data Vault Satellite" },
];

// Ingestr assets delegate the load to ingestr's incremental engine, which only
// supports these strategies (the SQL-only strategies are rejected by the CLI).
const INGESTR_STRATEGIES = ["create+replace", "delete+insert", "append", "merge", "truncate+insert"];
// scd2_by_time/scd2_by_column map to ingestr's "scd2".
const INGESTR_STRATEGIES = ["create+replace", "delete+insert", "append", "merge", "scd2_by_time", "scd2_by_column"];

const strategyOptions = computed(() =>
props.assetType === "ingestr"
Expand Down Expand Up @@ -1303,6 +1307,11 @@ function getStrategyDescription(strategy) {
"time_interval": "Process time-based data using incremental key",
"ddl":
"Use DDL to create a new table using the information provided in the embedded Bruin section",
"scd2_by_time": "Track history using a time column (requires incremental key)",
"scd2_by_column": "Track history by comparing column values",
"datavault_hub": "Load into a Data Vault hub table (business keys)",
"datavault_link": "Load into a Data Vault link table (relationships between hubs)",
"datavault_satellite": "Load into a Data Vault satellite table (descriptive/historical attributes)",
}[strategy];
}

Expand Down
Loading