@lightdash/cli 3.20.2 → 3.21.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.
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/dbt/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,eAAe,EACf,YAAY,EAMZ,KAAK,kBAAkB,EAC1B,MAAM,mBAAmB,CAAC;AAI3B,KAAK,uBAAuB,GAAG;IAC3B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAaF,eAAO,MAAM,gBAAgB,gBACZ,MAAM,mBACF,kBAAkB,UAC3B,eAAe,EAAE,mBACT,WAAW,CAAC,MAAM,CAAC,KACpC,OAAO,CAAC,uBAAuB,CAuEjC,CAAC"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/dbt/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,YAAY,EACZ,eAAe,EACf,YAAY,EAMZ,KAAK,kBAAkB,EAC1B,MAAM,mBAAmB,CAAC;AAI3B,KAAK,uBAAuB,GAAG;IAC3B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC9B,CAAC;AAaF,eAAO,MAAM,gBAAgB,gBACZ,MAAM,mBACF,kBAAkB,UAC3B,eAAe,EAAE,mBACT,WAAW,CAAC,MAAM,CAAC,KACpC,OAAO,CAAC,uBAAuB,CA8EjC,CAAC"}
@@ -41,6 +41,13 @@ const validateDbtModel = async (adapterType, manifestVersion, models, servedMode
41
41
  return acc;
42
42
  }
43
43
  const exploreError = {
44
+ dbtModelIdentity: {
45
+ sourceUuid: null,
46
+ sourceName: null,
47
+ packageName: model.package_name ?? '',
48
+ uniqueId: model.unique_id,
49
+ modelName: model.name,
50
+ },
44
51
  name: model.name,
45
52
  label: model.meta.label || (0, common_1.friendlyName)(model.name),
46
53
  errors: [error],
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/handlers/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAOH,OAAO,EACP,YAAY,EAiBf,MAAM,mBAAmB,CAAC;AAsB3B,OAAO,EAAE,iBAAiB,EAA8B,MAAM,eAAe,CAAC;AAI9E,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,CAAC;IACrC,iBAAiB,EAAE,OAAO,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,uBAAuB,YACvB,OAAO,GAAG,YAAY,KAChC,OAIW,CAAC;AAEf,eAAO,MAAM,0BAA0B,YAC1B,OAAO,GAAG,YAAY,KAChC,OAAO,GAAG,YAiBZ,CAAC;AAgTF,eAAO,MAAM,cAAc,YACd,qBAAqB,KAC/B,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AY,KAChC,OAAO,GAAG,YAiBZ,CAAC;AAgTF,eAAO,MAAM,cAAc,YACd,qBAAqB,KAC/B,OAAO,CAAC,oBAAoB,CAoc9B,CAAC;AAEF,eAAO,MAAM,OAAO,YACP,qBAAqB,KAC/B,OAAO,CAAC,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,CACO,CAAC;AAE7C,eAAO,MAAM,cAAc,oBACN,qBAAqB,kBAmCzC,CAAC"}
@@ -428,6 +428,7 @@ const compileProject = async (options) => {
428
428
  disableTimestampConversion: options.disableTimestampConversion,
429
429
  allowPartialCompilation,
430
430
  postProcessors: [common_1.preAggregatePostProcessor],
431
+ includeModelIdentity: true,
431
432
  });
432
433
  const validatedExplores = options.validateWarehouseColumns === true &&
433
434
  validationWarehouseClient
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../src/handlers/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,OAAO,EACP,YAAY,EASZ,KAAK,eAAe,EACpB,KAAK,YAAY,EAGpB,MAAM,mBAAmB,CAAC;AAoB3B,OAAO,EAAE,cAAc,EAAqB,MAAM,0BAA0B,CAAC;AAgB7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUlD,KAAK,oBAAoB,GAAG,iBAAiB,GAAG;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC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O,MAAM,MAAM,aACL,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,WAC3B,UAAU,KACpB,OAAO,CAAC,IAAI,CAiLd,CAAC;AAiGF,eAAO,MAAM,aAAa,oBAA2B,oBAAoB,kBAgMxE,CAAC"}
@@ -288,31 +288,6 @@ const deploy = async (explores, options) => {
288
288
  }
289
289
  const deployableExplores = explores.map(compile_1.stripWarehouseColumnErrors);
290
290
  const lightdashProjectConfig = await (0, lightdash_config_1.readAndLoadLightdashProjectConfig)(path_1.default.resolve(options.projectDir), options.projectUuid);
291
- // These two methods are not critical to the deployment process, so we can ignore errors and show warnings instead
292
- try {
293
- await replaceProjectYamlTags(options.projectUuid, lightdashProjectConfig);
294
- }
295
- catch (e) {
296
- console.error(styles.warning(`\nError replacing YAML tags: ${(0, common_1.getErrorMessage)(e)}\n`));
297
- }
298
- try {
299
- await replaceProjectParameters(options.projectUuid, lightdashProjectConfig);
300
- }
301
- catch (e) {
302
- console.error(styles.warning(`\nError replacing project parameters: ${(0, common_1.getErrorMessage)(e)}\n`));
303
- }
304
- try {
305
- await replaceProjectDefaults(options.projectUuid, lightdashProjectConfig);
306
- }
307
- catch (e) {
308
- console.error(styles.warning(`\nError replacing project defaults: ${(0, common_1.getErrorMessage)(e)}\n`));
309
- }
310
- try {
311
- await replaceProjectTableGroups(options.projectUuid, lightdashProjectConfig);
312
- }
313
- catch (e) {
314
- console.error(styles.warning(`\nError replacing project table groups: ${(0, common_1.getErrorMessage)(e)}\n`));
315
- }
316
291
  const shouldUseLegacyDeploy = options.batchedDeploy === false ||
317
292
  !(await deployBatched(deployableExplores, options));
318
293
  if (shouldUseLegacyDeploy) {
@@ -382,6 +357,30 @@ const deploy = async (explores, options) => {
382
357
  throw error;
383
358
  }
384
359
  }
360
+ try {
361
+ await replaceProjectYamlTags(options.projectUuid, lightdashProjectConfig);
362
+ }
363
+ catch (e) {
364
+ console.error(styles.warning(`\nError replacing YAML tags: ${(0, common_1.getErrorMessage)(e)}\n`));
365
+ }
366
+ try {
367
+ await replaceProjectParameters(options.projectUuid, lightdashProjectConfig);
368
+ }
369
+ catch (e) {
370
+ console.error(styles.warning(`\nError replacing project parameters: ${(0, common_1.getErrorMessage)(e)}\n`));
371
+ }
372
+ try {
373
+ await replaceProjectDefaults(options.projectUuid, lightdashProjectConfig);
374
+ }
375
+ catch (e) {
376
+ console.error(styles.warning(`\nError replacing project defaults: ${(0, common_1.getErrorMessage)(e)}\n`));
377
+ }
378
+ try {
379
+ await replaceProjectTableGroups(options.projectUuid, lightdashProjectConfig);
380
+ }
381
+ catch (e) {
382
+ console.error(styles.warning(`\nError replacing project table groups: ${(0, common_1.getErrorMessage)(e)}\n`));
383
+ }
385
384
  };
386
385
  exports.deploy = deploy;
387
386
  const createNewProject = async (executionId, options) => {
package/dist/index.js CHANGED
@@ -104,11 +104,15 @@ commander_1.program
104
104
  .name(styles.title('⚡️lightdash'))
105
105
  .description('Developer tools for dbt and Lightdash.\nSee https://docs.lightdash.com for more help and examples')
106
106
  .option('--non-interactive', 'Disable all interactive prompts. Commands fail with helpful error if required input is missing.')
107
- .hook('preAction', (thisCommand) => {
107
+ .hook('preAction', (thisCommand, actionCommand) => {
108
108
  const opts = thisCommand.opts();
109
109
  if (opts.nonInteractive) {
110
110
  globalState_1.default.setNonInteractive(true);
111
111
  }
112
+ if (['deploy', 'preview', 'start-preview'].includes(actionCommand.name()) &&
113
+ actionCommand.getOptionValueSource('source') === 'cli') {
114
+ console.error(styles.warning("--source is deprecated and will be ignored in a future release. Lightdash now works out which dbt source a deploy belongs to from your dbt project. You only need it if the deploy is rejected because the source can't be inferred."));
115
+ }
112
116
  })
113
117
  .showHelpAfterError(styles.bold('Run ⚡️lightdash help [command] for more information'))
114
118
  .addHelpText('after', `
@@ -318,7 +322,7 @@ commander_1.program
318
322
  commander_1.program
319
323
  .command('preview')
320
324
  .description('Creates a new preview project - waits for a keypress to stop')
321
- .option('--source <name>', 'The dbt source to deploy, by name. Its explores use the warehouse connection of that source. Overrides `lightdash config set-source`')
325
+ .option('--source <name>', '(deprecated) The dbt source to deploy, by name. Its explores use the warehouse connection of that source. Overrides `lightdash config set-source`')
322
326
  .option('--name <preview name>', 'Custom name for the preview. If a name is not provided, a unique, randomly generated name will be created.')
323
327
  .option('--project-dir <path>', 'The directory of the dbt project', env_1.DEFAULT_DBT_PROJECT_DIR)
324
328
  .option('--profiles-dir <path>', 'The directory of the dbt profiles', env_1.DEFAULT_DBT_PROFILES_DIR)
@@ -362,7 +366,7 @@ commander_1.program
362
366
  commander_1.program
363
367
  .command('start-preview')
364
368
  .description('Creates a new preview project')
365
- .option('--source <name>', 'The dbt source to deploy, by name. Its explores use the warehouse connection of that source. Overrides `lightdash config set-source`')
369
+ .option('--source <name>', '(deprecated) The dbt source to deploy, by name. Its explores use the warehouse connection of that source. Overrides `lightdash config set-source`')
366
370
  .option('--name [preview name]', '[required] Name for the preview project. If a preview project with this name already exists, it will be updated, otherwise it will create a new preview project ')
367
371
  .option('--project-dir <path>', 'The directory of the dbt project', env_1.DEFAULT_DBT_PROJECT_DIR)
368
372
  .option('--profiles-dir <path>', 'The directory of the dbt profiles', env_1.DEFAULT_DBT_PROFILES_DIR)
@@ -575,7 +579,7 @@ appsProgram
575
579
  commander_1.program
576
580
  .command('deploy')
577
581
  .description('Compiles and deploys a Lightdash project')
578
- .option('--source <name>', 'The dbt source to deploy, by name. Its explores use the warehouse connection of that source. Overrides `lightdash config set-source`')
582
+ .option('--source <name>', '(deprecated) The dbt source to deploy, by name. Its explores use the warehouse connection of that source. Overrides `lightdash config set-source`')
579
583
  .option('--project <project uuid or slug>', 'Project UUID or slug to deploy to. Overrides the default project configured via `lightdash config set-project`')
580
584
  .option('--project-dir <path>', 'The directory of the dbt project', env_1.DEFAULT_DBT_PROJECT_DIR)
581
585
  .option('--profiles-dir <path>', 'The directory of the dbt profiles', env_1.DEFAULT_DBT_PROFILES_DIR)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "3.20.2",
3
+ "version": "3.21.0",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -22,8 +22,8 @@
22
22
  "@actions/core": "1.11.1",
23
23
  "@aws-sdk/credential-providers": "3.995.0",
24
24
  "@casl/ability": "6.8.0",
25
- "@lightdash/common": "3.20.2",
26
- "@lightdash/warehouses": "3.20.2",
25
+ "@lightdash/common": "3.21.0",
26
+ "@lightdash/warehouses": "3.21.0",
27
27
  "@sidvind/better-ajv-errors": "7.0.0",
28
28
  "@types/columnify": "1.5.1",
29
29
  "ajv": "8.18.0",