@dbx-tools/genie 0.3.28 → 0.3.30

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/src/space.ts +4 -9
package/package.json CHANGED
@@ -16,16 +16,16 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@databricks/sdk-experimental": "^0.17.0",
19
- "@dbx-tools/shared-core": "0.3.28",
20
- "@dbx-tools/shared-genie": "0.3.28",
21
- "@dbx-tools/appkit": "0.3.28"
19
+ "@dbx-tools/appkit": "0.3.30",
20
+ "@dbx-tools/shared-genie": "0.3.30",
21
+ "@dbx-tools/shared-core": "0.3.30"
22
22
  },
23
23
  "main": "index.ts",
24
24
  "license": "UNLICENSED",
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
- "version": "0.3.28",
28
+ "version": "0.3.30",
29
29
  "types": "index.ts",
30
30
  "type": "module",
31
31
  "exports": {
package/src/space.ts CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  import { WorkspaceClient } from "@databricks/sdk-experimental";
17
17
  import { databricks } from "@dbx-tools/appkit";
18
- import { error, log, object, string } from "@dbx-tools/shared-core";
18
+ import { json, log, object, string } from "@dbx-tools/shared-core";
19
19
  import { genieModel, type GenieSpace } from "@dbx-tools/shared-genie";
20
20
 
21
21
  const logger = log.logger("genie/space");
@@ -89,14 +89,9 @@ interface SerializedSampleQuestion {
89
89
  export function genieSampleQuestions(space: GenieSpace): string[] {
90
90
  const serialized = space.serialized_space;
91
91
  if (!serialized) return [];
92
- let parsed: unknown;
93
- try {
94
- parsed = JSON.parse(serialized);
95
- } catch (err) {
96
- logger.warn("serialized-space:parse-error", {
97
- spaceId: space.space_id,
98
- error: error.errorMessage(err),
99
- });
92
+ const parsed = json.parse(serialized);
93
+ if (parsed === undefined) {
94
+ logger.warn("serialized-space:parse-error", { spaceId: space.space_id });
100
95
  return [];
101
96
  }
102
97
  const sampleQuestions = (parsed as { config?: { sample_questions?: unknown } } | null)?.config