diff --git a/package-lock.json b/package-lock.json index 4a7ad257f..8a28bc6ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vscode-dbt-power-user", - "version": "0.50.3", + "version": "0.50.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vscode-dbt-power-user", - "version": "0.50.3", + "version": "0.50.4", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index c25fa390d..7c26e5caf 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "bugs": { "url": "https://github.com/AltimateAI/vscode-dbt-power-user/issues" }, - "version": "0.50.3", + "version": "0.50.4", "engines": { "vscode": "^1.81.0" }, diff --git a/src/altimate.ts b/src/altimate.ts index 267861a69..34e854adf 100644 --- a/src/altimate.ts +++ b/src/altimate.ts @@ -647,8 +647,12 @@ export class AltimateRequest { status: response.status, textResponse, }); + let jsonResponse: any; + try { + jsonResponse = JSON.parse(textResponse); + } catch {} throw new APIError( - `Could not process request, server responded with ${response.status}: ${textResponse}`, + `Could not process request, server responded with ${response.status}: ${jsonResponse?.detail || textResponse}`, ); } catch (e) { this.dbtTerminal.error("apiCatchAllError", "catchAllError", e, true, { diff --git a/src/dbt_client/dbtCloudIntegration.ts b/src/dbt_client/dbtCloudIntegration.ts index 875d3b8cf..4ea951220 100644 --- a/src/dbt_client/dbtCloudIntegration.ts +++ b/src/dbt_client/dbtCloudIntegration.ts @@ -239,7 +239,7 @@ export class DBTCloudProjectIntegration } else { this.initializePaths(); } - if (!this.adapterType) { + if (this.adapterType === "unknown") { // We only fetch the adapter type once, as it may impact compilation preview otherwise await this.findAdapterType(); } diff --git a/src/manifest/dbtWorkspaceFolder.ts b/src/manifest/dbtWorkspaceFolder.ts index 00428a002..34bb6a2d8 100755 --- a/src/manifest/dbtWorkspaceFolder.ts +++ b/src/manifest/dbtWorkspaceFolder.ts @@ -82,11 +82,14 @@ export class DBTWorkspaceFolder implements Disposable { } async discoverProjects() { + // Ignore dbt_packages and venv/site-packages/dbt project folders + const excludePattern = "**/{dbt_packages,site-packages}"; const dbtProjectFiles = await workspace.findFiles( new RelativePattern( this.workspaceFolder, `**/${DBTProject.DBT_PROJECT_FILE}`, ), + new RelativePattern(this.workspaceFolder, excludePattern), ); this.dbtTerminal.info( "discoverProjects", diff --git a/src/webview_provider/newLineagePanel.ts b/src/webview_provider/newLineagePanel.ts index 7b4d38db6..ada8156f8 100644 --- a/src/webview_provider/newLineagePanel.ts +++ b/src/webview_provider/newLineagePanel.ts @@ -460,6 +460,11 @@ export class NewLineagePanel .getProject() ?.throwDiagnosticsErrorIfAvailable(); } catch (err) { + this.dbtTerminal.error( + "Lineage:getMissingLineageMessage", + (err as Error).message, + err, + ); return { message: (err as Error).message, type: "error" }; } @@ -476,6 +481,7 @@ export class NewLineagePanel const aiEnabled = this.altimate.enabled(); const event = this.queryManifestService.getEventByCurrentProject(); if (!event?.event) { + this.dbtTerminal.info("Lineage:getStartingNode", "No event found"); return { aiEnabled, missingLineageMessage: this.getMissingLineageMessage(), @@ -485,6 +491,10 @@ export class NewLineagePanel const tableName = this.getFilename(); const _node = nodeMetaMap.lookupByBaseName(tableName); if (!_node) { + this.dbtTerminal.info( + "Lineage:getStartingNode", + `No node found for ${tableName}`, + ); return { aiEnabled, missingLineageMessage: this.getMissingLineageMessage(), diff --git a/webview_panels/src/modules/documentationEditor/components/documentationPropagation/DocumentationPropagation.tsx b/webview_panels/src/modules/documentationEditor/components/documentationPropagation/DocumentationPropagation.tsx index cd4960493..0300cba38 100644 --- a/webview_panels/src/modules/documentationEditor/components/documentationPropagation/DocumentationPropagation.tsx +++ b/webview_panels/src/modules/documentationEditor/components/documentationPropagation/DocumentationPropagation.tsx @@ -60,6 +60,7 @@ export const DocumentationPropagationButton = ({ const [allColumns, setAllColumns] = useState([]); const [currColumns, setCurrColumns] = useState([]); const [isLoading, setIsLoading] = useState(false); + const [isSaved, setIsSaved] = useState(false); const [tableMetadata, setTableMetadata] = useState([]); const [testsMetadata, setTestsMetadata] = useState>( {}, @@ -72,6 +73,7 @@ export const DocumentationPropagationButton = ({ setAllColumns([]); setCurrColumns(startColumn); setTableMetadata([]); + setIsSaved(false); }, [currentDocsData?.uniqueId, name]); const loadMoreDownstreamModels = async () => { @@ -165,6 +167,7 @@ export const DocumentationPropagationButton = ({ } await executeRequestInSync("saveDocumentationBulk", { models: req }); + setIsSaved(true); }; const setAllColumnsValue = (value: boolean) => { @@ -183,6 +186,10 @@ export const DocumentationPropagationButton = ({ return null; } + if (!currColumnDescription) { + return null; + } + return (
-
Model:
+
Model:
{currentDocsData?.name}
-
Column:
+
Column:
{name}
{currColumnDescription && ( -
-
Description:
+
+
Description:
{currColumnDescription}
)} - - - - - - {allColumns.map((item) => { - const key = item.model + "/" + item.column; - return ( - - - setSelectedColumns((prev) => ({ - ...prev, - [key]: !prev[key], - })) - } - /> - -
-
Model:
-
{item.model.split(".").pop()}
-
-
-
Column:
-
{item.column}
-
-
-
Description:
-
{item.description}
-
-
-
- ); - })} - {currColumns.length > 0 && ( - - )} - -
+ {!isLoading && allColumns.length === 0 ? ( +
+ No downstream column level lineage detected to propagate the + documentation +
+ ) : ( + <> + + + + + + {allColumns.map((item) => { + const key = item.model + "/" + item.column; + return ( + + + setSelectedColumns((prev) => ({ + ...prev, + [key]: !prev[key], + })) + } + /> + +
+
Model:
+
{item.model.split(".").pop()}
+
+
+
Column:
+
{item.column}
+
+
+
Description:
+
{item.description}
+
+
+
+ ); + })} + {currColumns.length > 0 && ( + + )} + + {isSaved &&
Saved documentation successfully
} +
+ + )} ); }; diff --git a/webview_panels/src/modules/documentationEditor/components/documentationPropagation/styles.module.scss b/webview_panels/src/modules/documentationEditor/components/documentationPropagation/styles.module.scss index 084ec6460..2ff8c245a 100644 --- a/webview_panels/src/modules/documentationEditor/components/documentationPropagation/styles.module.scss +++ b/webview_panels/src/modules/documentationEditor/components/documentationPropagation/styles.module.scss @@ -9,7 +9,18 @@ grid-template-columns: 1fr 3fr; :nth-child(1) { - font-weight: 500; + font-weight: 600; + } + + :nth-child(2) { + line-break: anywhere; + color: var(--text-grey2-color); + } +} + +.colDesc { + :nth-child(1) { + font-weight: 600; } :nth-child(2) {