@lightdash/cli 0.2338.1 → 0.2340.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,7 @@ type ValidateHandlerOptions = CompileHandlerOptions & {
|
|
|
14
14
|
verbose: boolean;
|
|
15
15
|
preview: boolean;
|
|
16
16
|
only: ValidationTarget[];
|
|
17
|
+
showChartConfigurationWarnings: boolean;
|
|
17
18
|
};
|
|
18
19
|
export declare const waitUntilFinished: (jobUuid: string) => Promise<string>;
|
|
19
20
|
export declare const validateHandler: (options: ValidateHandlerOptions) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/handlers/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,OAAO,EACP,YAAY,EAMZ,kBAAkB,
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/handlers/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,OAAO,EACP,YAAY,EAMZ,kBAAkB,EAGlB,gBAAgB,EACnB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAAW,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAG3D,eAAO,MAAM,iBAAiB,gBACb,MAAM,YACT,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,qBACjB,gBAAgB,EAAE;;EAMnC,CAAC;AAEP,eAAO,MAAM,WAAW,YAAmB,MAAM;;;EAK3C,CAAC;AAEP,eAAO,MAAM,aAAa,gBAAuB,MAAM,SAAS,MAAM,8DAKhE,CAAC;AAEP,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAI/B;AAWD,KAAK,sBAAsB,GAAG,qBAAqB,GAAG;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,8BAA8B,EAAE,OAAO,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,iBAAiB,YAAmB,MAAM,KAAG,OAAO,CAAC,MAAM,CAYvE,CAAC;AAEF,eAAO,MAAM,eAAe,YAAmB,sBAAsB,kBAsKpE,CAAC"}
|
|
@@ -79,10 +79,19 @@ const validateHandler = async (options) => {
|
|
|
79
79
|
const { jobId } = validationJob;
|
|
80
80
|
const spinner = globalState_1.default.startSpinner(` Waiting for validation to finish`);
|
|
81
81
|
await (0, exports.waitUntilFinished)(jobId);
|
|
82
|
-
const
|
|
82
|
+
const allValidation = await (0, exports.getValidation)(projectUuid, jobId);
|
|
83
|
+
// Filter out chart configuration warnings unless explicitly requested
|
|
84
|
+
const validation = options.showChartConfigurationWarnings
|
|
85
|
+
? allValidation
|
|
86
|
+
: allValidation.filter((v) => !(0, common_1.isChartValidationError)(v) ||
|
|
87
|
+
v.errorType !== common_1.ValidationErrorType.ChartConfiguration);
|
|
88
|
+
const hiddenWarningsCount = allValidation.length - validation.length;
|
|
83
89
|
if (validation.length === 0) {
|
|
84
90
|
const timeInSeconds = new Date().getTime() - timeStart.getTime();
|
|
85
|
-
|
|
91
|
+
const hiddenMessage = hiddenWarningsCount > 0
|
|
92
|
+
? ` (${hiddenWarningsCount} chart configuration warning${hiddenWarningsCount > 1 ? 's' : ''} hidden, use --show-chart-configuration-warnings to show)`
|
|
93
|
+
: '';
|
|
94
|
+
spinner?.succeed(` Validation finished without errors in ${Math.trunc(timeInSeconds / 1000)}s${hiddenMessage}`);
|
|
86
95
|
}
|
|
87
96
|
else {
|
|
88
97
|
const timeInSeconds = new Date().getTime() - timeStart.getTime();
|
|
@@ -126,6 +135,9 @@ const validateHandler = async (options) => {
|
|
|
126
135
|
});
|
|
127
136
|
console.error(columns);
|
|
128
137
|
console.error(`\n--> To see these errors in Lightdash, run ${styles.bold(`lightdash preview`)}`);
|
|
138
|
+
if (hiddenWarningsCount > 0) {
|
|
139
|
+
console.error(`\n${styles.secondary(`Note: ${hiddenWarningsCount} chart configuration warning${hiddenWarningsCount > 1 ? 's' : ''} hidden. Use --show-chart-configuration-warnings to show.`)}`);
|
|
140
|
+
}
|
|
129
141
|
process.exit(1);
|
|
130
142
|
}
|
|
131
143
|
};
|
package/dist/index.js
CHANGED
|
@@ -326,6 +326,7 @@ commander_1.program
|
|
|
326
326
|
.option('--skip-warehouse-catalog', 'Skip fetch warehouse catalog and use types in yml', false)
|
|
327
327
|
.option('--use-dbt-list [true|false]', 'Use `dbt list` instead of `dbt compile` to generate dbt manifest.json', parseUseDbtListOption, true)
|
|
328
328
|
.option('--disable-timestamp-conversion [true|false]', 'Disable timestamp conversion to UTC for Snowflake warehouses. Only use this if your timestamp values are already in UTC.', parseDisableTimestampConversionOption, false)
|
|
329
|
+
.option('--show-chart-configuration-warnings', 'Show chart configuration warnings (e.g., unused dimensions). These are hidden by default.', false)
|
|
329
330
|
.addOption(new commander_1.Option('--only <elems...>', 'Specify project elements to validate')
|
|
330
331
|
.choices(Object.values(common_1.ValidationTarget))
|
|
331
332
|
.default(Object.values(common_1.ValidationTarget)))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightdash/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2340.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"unique-names-generator": "^4.7.1",
|
|
39
39
|
"uuid": "^11.0.3",
|
|
40
40
|
"yaml": "^2.7.0",
|
|
41
|
-
"@lightdash/common": "0.
|
|
42
|
-
"@lightdash/warehouses": "0.
|
|
41
|
+
"@lightdash/common": "0.2340.0",
|
|
42
|
+
"@lightdash/warehouses": "0.2340.0"
|
|
43
43
|
},
|
|
44
44
|
"description": "Lightdash CLI tool",
|
|
45
45
|
"devDependencies": {
|