@finos/legend-application-studio 28.21.45 → 28.21.47
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.
- package/lib/__lib__/LegendStudioEvent.d.ts +63 -1
- package/lib/__lib__/LegendStudioEvent.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioEvent.js +90 -0
- package/lib/__lib__/LegendStudioEvent.js.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts +655 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.d.ts.map +1 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js +709 -1
- package/lib/__lib__/LegendStudioTelemetryHelper.js.map +1 -1
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.d.ts +30 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.d.ts.map +1 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.js +43 -0
- package/lib/components/editor/editor-group/LegendAISuggestTelemetryHooks.js.map +1 -0
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts +4 -3
- package/lib/components/editor/editor-group/RuntimeEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/RuntimeEditor.js +90 -36
- package/lib/components/editor/editor-group/RuntimeEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js +154 -35
- package/lib/components/editor/editor-group/dataProduct/DataProductEditor.js.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.d.ts.map +1 -1
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js +4 -6
- package/lib/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js +31 -7
- package/lib/components/editor/editor-group/service-editor/ServiceEditor.js.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.d.ts.map +1 -1
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js +4 -8
- package/lib/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.js.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.d.ts.map +1 -1
- package/lib/components/editor/side-bar/WorkflowManager.js +15 -0
- package/lib/components/editor/side-bar/WorkflowManager.js.map +1 -1
- package/lib/index.css +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/stores/editor/EditorGraphState.d.ts.map +1 -1
- package/lib/stores/editor/EditorGraphState.js +17 -1
- package/lib/stores/editor/EditorGraphState.js.map +1 -1
- package/lib/stores/editor/EditorStore.d.ts +2 -0
- package/lib/stores/editor/EditorStore.d.ts.map +1 -1
- package/lib/stores/editor/EditorStore.js +12 -0
- package/lib/stores/editor/EditorStore.js.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.d.ts +18 -1
- package/lib/stores/editor/EditorTabManagerState.d.ts.map +1 -1
- package/lib/stores/editor/EditorTabManagerState.js +90 -1
- package/lib/stores/editor/EditorTabManagerState.js.map +1 -1
- package/lib/stores/editor/EditorTabTelemetryHelper.d.ts +31 -0
- package/lib/stores/editor/EditorTabTelemetryHelper.d.ts.map +1 -0
- package/lib/stores/editor/EditorTabTelemetryHelper.js +55 -0
- package/lib/stores/editor/EditorTabTelemetryHelper.js.map +1 -0
- package/lib/stores/editor/GraphEditFormModeState.d.ts.map +1 -1
- package/lib/stores/editor/GraphEditFormModeState.js +22 -1
- package/lib/stores/editor/GraphEditFormModeState.js.map +1 -1
- package/lib/stores/editor/LegendAISuggestTelemetry.d.ts +143 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.d.ts.map +1 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.js +376 -0
- package/lib/stores/editor/LegendAISuggestTelemetry.js.map +1 -0
- package/lib/stores/editor/LegendSQLStudioPlaygroundState.js +3 -3
- package/lib/stores/editor/LegendSQLStudioPlaygroundState.js.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts +14 -3
- package/lib/stores/editor/editor-state/GraphGenerationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/GraphGenerationState.js +42 -5
- package/lib/stores/editor/editor-state/GraphGenerationState.js.map +1 -1
- package/lib/stores/editor/editor-state/ModelImporterState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/ModelImporterState.js +2 -1
- package/lib/stores/editor/editor-state/ModelImporterState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.js +14 -0
- package/lib/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts +35 -6
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js +74 -29
- package/lib/stores/editor/editor-state/element-editor-state/RuntimeEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.d.ts +5 -0
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.js +13 -0
- package/lib/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts +1 -0
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js +5 -5
- package/lib/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts +12 -0
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js +60 -14
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts +5 -0
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js +13 -0
- package/lib/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js +21 -2
- package/lib/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.d.ts +5 -0
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.js +13 -0
- package/lib/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js +34 -0
- package/lib/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js +48 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js +5 -11
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts +3 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js +46 -17
- package/lib/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.js.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts +7 -0
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js +110 -16
- package/lib/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.js.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts +2 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.d.ts.map +1 -1
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js +10 -4
- package/lib/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js +40 -1
- package/lib/stores/editor/sidebar-state/BulkServiceRegistrationState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/LocalChangesState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/LocalChangesState.js +1 -0
- package/lib/stores/editor/sidebar-state/LocalChangesState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js +51 -0
- package/lib/stores/editor/sidebar-state/ProjectOverviewState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts +14 -0
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js +132 -27
- package/lib/stores/editor/sidebar-state/WorkflowManagerState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js +41 -0
- package/lib/stores/editor/sidebar-state/WorkspaceReviewState.js.map +1 -1
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.d.ts.map +1 -1
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js +71 -9
- package/lib/stores/editor/sidebar-state/testable/GlobalTestRunnerState.js.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.d.ts +12 -2
- package/lib/stores/editor/utils/MockDataUtils.d.ts.map +1 -1
- package/lib/stores/editor/utils/MockDataUtils.js +28 -28
- package/lib/stores/editor/utils/MockDataUtils.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts +2 -0
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js +13 -0
- package/lib/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.js.map +1 -1
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts +20 -2
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.d.ts.map +1 -1
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js +38 -4
- package/lib/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.js.map +1 -1
- package/lib/stores/project-reviewer/ProjectReviewerStore.d.ts.map +1 -1
- package/lib/stores/project-reviewer/ProjectReviewerStore.js +45 -0
- package/lib/stores/project-reviewer/ProjectReviewerStore.js.map +1 -1
- package/lib/stores/workspace-setup/WorkspaceSetupStore.d.ts.map +1 -1
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js +48 -4
- package/lib/stores/workspace-setup/WorkspaceSetupStore.js.map +1 -1
- package/package.json +9 -9
- package/src/__lib__/LegendStudioEvent.ts +102 -0
- package/src/__lib__/LegendStudioTelemetryHelper.ts +1769 -311
- package/src/components/editor/editor-group/LegendAISuggestTelemetryHooks.ts +57 -0
- package/src/components/editor/editor-group/RuntimeEditor.tsx +282 -132
- package/src/components/editor/editor-group/dataProduct/DataProductEditor.tsx +293 -106
- package/src/components/editor/editor-group/dataProduct/DataProductQueryBuilderHelper.ts +3 -13
- package/src/components/editor/editor-group/service-editor/ServiceEditor.tsx +41 -23
- package/src/components/editor/editor-group/service-editor/testable/ServiceTestDataEditor.tsx +5 -11
- package/src/components/editor/side-bar/WorkflowManager.tsx +24 -0
- package/src/index.ts +17 -1
- package/src/stores/editor/EditorGraphState.ts +30 -1
- package/src/stores/editor/EditorStore.ts +22 -0
- package/src/stores/editor/EditorTabManagerState.ts +128 -1
- package/src/stores/editor/EditorTabTelemetryHelper.ts +70 -0
- package/src/stores/editor/GraphEditFormModeState.ts +35 -1
- package/src/stores/editor/LegendAISuggestTelemetry.ts +592 -0
- package/src/stores/editor/LegendSQLStudioPlaygroundState.ts +3 -3
- package/src/stores/editor/editor-state/GraphGenerationState.ts +68 -9
- package/src/stores/editor/editor-state/ModelImporterState.ts +2 -0
- package/src/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.ts +30 -0
- package/src/stores/editor/editor-state/element-editor-state/RuntimeEditorState.ts +92 -31
- package/src/stores/editor/editor-state/element-editor-state/availability/testable/AvailabilityTestableState.ts +17 -0
- package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts +6 -6
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts +75 -17
- package/src/stores/editor/editor-state/element-editor-state/dataProduct/testable/DataProductTestableState.ts +17 -0
- package/src/stores/editor/editor-state/element-editor-state/function-activator/testable/FunctionTestableState.ts +27 -2
- package/src/stores/editor/editor-state/element-editor-state/ingest/IngestTestableState.ts +17 -0
- package/src/stores/editor/editor-state/element-editor-state/mapping/testable/MappingTestableState.ts +57 -0
- package/src/stores/editor/editor-state/element-editor-state/service/ServiceRegistrationState.ts +74 -0
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestDataState.ts +22 -21
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestEditorState.ts +9 -0
- package/src/stores/editor/editor-state/element-editor-state/service/testable/ServiceTestableState.ts +78 -21
- package/src/stores/editor/editor-state/element-editor-state/testable/TestableEditorState.ts +205 -18
- package/src/stores/editor/editor-state/project-configuration-editor-state/ProjectConfigurationEditorState.ts +38 -3
- package/src/stores/editor/sidebar-state/BulkServiceRegistrationState.ts +71 -1
- package/src/stores/editor/sidebar-state/LocalChangesState.ts +4 -0
- package/src/stores/editor/sidebar-state/ProjectOverviewState.ts +114 -0
- package/src/stores/editor/sidebar-state/WorkflowManagerState.ts +250 -29
- package/src/stores/editor/sidebar-state/WorkspaceReviewState.ts +84 -0
- package/src/stores/editor/sidebar-state/testable/GlobalTestRunnerState.ts +124 -17
- package/src/stores/editor/utils/MockDataUtils.ts +33 -32
- package/src/stores/graph-modifier/DSL_DataProduct_GraphModifierHelper.ts +18 -0
- package/src/stores/graph-modifier/DSL_LakehouseRuntime_GraphModifierHelper.ts +62 -7
- package/src/stores/project-reviewer/ProjectReviewerStore.ts +97 -0
- package/src/stores/workspace-setup/WorkspaceSetupStore.ts +87 -4
- package/tsconfig.json +3 -0
|
@@ -52,6 +52,10 @@ import { ExternalFormatState } from './ExternalFormatState.js';
|
|
|
52
52
|
import { ExplorerTreeRootPackageLabel } from '../ExplorerTreeState.js';
|
|
53
53
|
import type { DSL_Generation_LegendStudioApplicationPlugin_Extension } from '../../extensions/DSL_Generation_LegendStudioApplicationPlugin_Extension.js';
|
|
54
54
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../__lib__/LegendStudioEvent.js';
|
|
55
|
+
import {
|
|
56
|
+
GENERATION_MODE,
|
|
57
|
+
LegendStudioTelemetryHelper,
|
|
58
|
+
} from '../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
55
59
|
import {
|
|
56
60
|
FileSystem_Directory,
|
|
57
61
|
type FileSystemTreeNodeData,
|
|
@@ -149,15 +153,19 @@ export class DEPREACTED_GlobalFileGenerationState {
|
|
|
149
153
|
/**
|
|
150
154
|
* Generated file generations in the graph.
|
|
151
155
|
* NOTE: This method does not update graph and application only the files are generated.
|
|
156
|
+
*
|
|
157
|
+
* Errors are handled (logged + notified) here and returned rather than
|
|
158
|
+
* re-thrown so the caller can keep generating; the caller owns the
|
|
159
|
+
* `editor.generation.*` telemetry outcome.
|
|
152
160
|
*/
|
|
153
161
|
*DEPREACTED_generateFiles(
|
|
154
162
|
generationOutputIndex: Map<string, GenerationOutput[]>,
|
|
155
|
-
): GeneratorFn<
|
|
163
|
+
): GeneratorFn<Error | undefined> {
|
|
156
164
|
try {
|
|
157
165
|
const generationSpecs =
|
|
158
166
|
this.editorStore.graphManagerState.graph.ownGenerationSpecifications;
|
|
159
167
|
if (!generationSpecs.length) {
|
|
160
|
-
return;
|
|
168
|
+
return undefined;
|
|
161
169
|
}
|
|
162
170
|
assertTrue(
|
|
163
171
|
generationSpecs.length === 1,
|
|
@@ -188,6 +196,7 @@ export class DEPREACTED_GlobalFileGenerationState {
|
|
|
188
196
|
}
|
|
189
197
|
generationOutputIndex.set(fileGeneration.value.path, result);
|
|
190
198
|
}
|
|
199
|
+
return undefined;
|
|
191
200
|
} catch (error) {
|
|
192
201
|
assertErrorThrown(error);
|
|
193
202
|
this.editorStore.applicationStore.logService.error(
|
|
@@ -197,6 +206,7 @@ export class DEPREACTED_GlobalFileGenerationState {
|
|
|
197
206
|
this.editorStore.graphState.editorStore.applicationStore.notificationService.notifyError(
|
|
198
207
|
`${error.message}`,
|
|
199
208
|
);
|
|
209
|
+
return error;
|
|
200
210
|
}
|
|
201
211
|
}
|
|
202
212
|
|
|
@@ -310,15 +320,53 @@ export class GraphGenerationState {
|
|
|
310
320
|
return;
|
|
311
321
|
}
|
|
312
322
|
this.isRunningGlobalGenerate = true;
|
|
323
|
+
const startedAt = Date.now();
|
|
324
|
+
const sourceInfo = this.editorStore.editorMode.getSourceInfo();
|
|
325
|
+
const telemetryBase = {
|
|
326
|
+
mode: GENERATION_MODE.GLOBAL,
|
|
327
|
+
enableArtifactGeneration: this.enableArtifactGeneration,
|
|
328
|
+
};
|
|
329
|
+
LegendStudioTelemetryHelper.logEvent_GenerationLaunched(
|
|
330
|
+
this.editorStore.applicationStore.telemetryService,
|
|
331
|
+
sourceInfo,
|
|
332
|
+
telemetryBase,
|
|
333
|
+
);
|
|
313
334
|
try {
|
|
314
|
-
|
|
315
|
-
|
|
335
|
+
// NOTE: both steps handle (log + notify) their own errors and return
|
|
336
|
+
// them instead of throwing, so artifact generation still runs when
|
|
337
|
+
// model generation fails. We only decide the telemetry outcome here so
|
|
338
|
+
// each run emits exactly one terminal event.
|
|
339
|
+
const modelGenerationError = (yield flowResult(this.generateModels())) as
|
|
340
|
+
| Error
|
|
341
|
+
| undefined;
|
|
342
|
+
const artifactGenerationError = (yield flowResult(
|
|
343
|
+
this.generateArtifacts(),
|
|
344
|
+
)) as Error | undefined;
|
|
345
|
+
const generationError = modelGenerationError ?? artifactGenerationError;
|
|
346
|
+
if (generationError) {
|
|
347
|
+
LegendStudioTelemetryHelper.logEvent_GenerationFailure(
|
|
348
|
+
this.editorStore.applicationStore.telemetryService,
|
|
349
|
+
sourceInfo,
|
|
350
|
+
{ ...telemetryBase, errorMessage: generationError.message },
|
|
351
|
+
);
|
|
352
|
+
} else {
|
|
353
|
+
LegendStudioTelemetryHelper.logEvent_GenerationSucceeded(
|
|
354
|
+
this.editorStore.applicationStore.telemetryService,
|
|
355
|
+
sourceInfo,
|
|
356
|
+
{ ...telemetryBase, durationMs: Date.now() - startedAt },
|
|
357
|
+
);
|
|
358
|
+
}
|
|
316
359
|
} catch (error) {
|
|
317
360
|
assertErrorThrown(error);
|
|
318
361
|
this.editorStore.applicationStore.logService.error(
|
|
319
362
|
LogEvent.create(LEGEND_STUDIO_APP_EVENT.GENERATION_FAILURE),
|
|
320
363
|
error,
|
|
321
364
|
);
|
|
365
|
+
LegendStudioTelemetryHelper.logEvent_GenerationFailure(
|
|
366
|
+
this.editorStore.applicationStore.telemetryService,
|
|
367
|
+
sourceInfo,
|
|
368
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
369
|
+
);
|
|
322
370
|
this.editorStore.graphState.editorStore.applicationStore.notificationService.notifyError(
|
|
323
371
|
`${error.message}`,
|
|
324
372
|
);
|
|
@@ -327,13 +375,17 @@ export class GraphGenerationState {
|
|
|
327
375
|
}
|
|
328
376
|
}
|
|
329
377
|
|
|
330
|
-
|
|
378
|
+
/**
|
|
379
|
+
* Errors are handled (logged + notified) here and returned rather than
|
|
380
|
+
* re-thrown; see {@link GraphGenerationState.globalGenerate}.
|
|
381
|
+
*/
|
|
382
|
+
*generateModels(): GeneratorFn<Error | undefined> {
|
|
331
383
|
try {
|
|
332
384
|
this.generatedEntities = new Map<string, Entity[]>(); // reset the map of generated entities
|
|
333
385
|
const generationSpecs =
|
|
334
386
|
this.editorStore.graphManagerState.graph.ownGenerationSpecifications;
|
|
335
387
|
if (!generationSpecs.length) {
|
|
336
|
-
return;
|
|
388
|
+
return undefined;
|
|
337
389
|
}
|
|
338
390
|
assertTrue(
|
|
339
391
|
generationSpecs.length === 1,
|
|
@@ -369,6 +421,7 @@ export class GraphGenerationState {
|
|
|
369
421
|
this.editorStore.graphState.updateGenerationGraphAndApplication(),
|
|
370
422
|
);
|
|
371
423
|
}
|
|
424
|
+
return undefined;
|
|
372
425
|
} catch (error) {
|
|
373
426
|
assertErrorThrown(error);
|
|
374
427
|
this.editorStore.applicationStore.logService.error(
|
|
@@ -378,23 +431,27 @@ export class GraphGenerationState {
|
|
|
378
431
|
this.editorStore.graphState.editorStore.applicationStore.notificationService.notifyError(
|
|
379
432
|
`${error.message}`,
|
|
380
433
|
);
|
|
434
|
+
return error;
|
|
381
435
|
}
|
|
382
436
|
}
|
|
383
437
|
|
|
384
438
|
/**
|
|
385
439
|
* Generated artifacts generations in graph
|
|
386
440
|
* NOTE: This method does not update graph and application only the files are generated.
|
|
441
|
+
*
|
|
442
|
+
* Errors are handled (logged + notified) here and returned rather than
|
|
443
|
+
* re-thrown; see {@link GraphGenerationState.globalGenerate}.
|
|
387
444
|
*/
|
|
388
|
-
*generateArtifacts(): GeneratorFn<
|
|
445
|
+
*generateArtifacts(): GeneratorFn<Error | undefined> {
|
|
389
446
|
try {
|
|
390
447
|
this.emptyGeneratedArtifacts();
|
|
391
448
|
const generationOutputIndex = new Map<string, GenerationOutput[]>();
|
|
392
449
|
// handle deprecated file generations
|
|
393
|
-
yield flowResult(
|
|
450
|
+
const fileGenerationError = (yield flowResult(
|
|
394
451
|
this.globalFileGenerationState.DEPREACTED_generateFiles(
|
|
395
452
|
generationOutputIndex,
|
|
396
453
|
),
|
|
397
|
-
);
|
|
454
|
+
)) as Error | undefined;
|
|
398
455
|
let artifacts = new ArtifactGenerationExtensionResult();
|
|
399
456
|
if (this.enableArtifactGeneration) {
|
|
400
457
|
artifacts =
|
|
@@ -406,6 +463,7 @@ export class GraphGenerationState {
|
|
|
406
463
|
|
|
407
464
|
// handle results
|
|
408
465
|
this.processGenerationResult(artifacts, generationOutputIndex);
|
|
466
|
+
return fileGenerationError;
|
|
409
467
|
} catch (error) {
|
|
410
468
|
assertErrorThrown(error);
|
|
411
469
|
this.editorStore.applicationStore.logService.error(
|
|
@@ -415,6 +473,7 @@ export class GraphGenerationState {
|
|
|
415
473
|
this.editorStore.graphState.editorStore.applicationStore.notificationService.notifyError(
|
|
416
474
|
`${error.message}`,
|
|
417
475
|
);
|
|
476
|
+
return error;
|
|
418
477
|
}
|
|
419
478
|
}
|
|
420
479
|
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
assertTrue,
|
|
34
34
|
} from '@finos/legend-shared';
|
|
35
35
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../__lib__/LegendStudioEvent.js';
|
|
36
|
+
import { PROJECT_CONFIG_UPDATE_ACTION } from '../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
36
37
|
import type { EditorStore } from '../EditorStore.js';
|
|
37
38
|
import { generateGAVCoordinates, type Entity } from '@finos/legend-storage';
|
|
38
39
|
import { DEFAULT_TAB_SIZE } from '@finos/legend-application';
|
|
@@ -379,6 +380,7 @@ export class ExecuteInputDebugModelImporterEditorState extends ModelImporterEdit
|
|
|
379
380
|
await flowResult(
|
|
380
381
|
this.editorStore.projectConfigurationEditorState.updateProjectConfiguration(
|
|
381
382
|
updateProjectConfigurationCommand,
|
|
383
|
+
PROJECT_CONFIG_UPDATE_ACTION.UPDATE_CONFIGS,
|
|
382
384
|
),
|
|
383
385
|
);
|
|
384
386
|
// open the debugger element
|
package/src/stores/editor/editor-state/element-editor-state/ElementExternalFormatGenerationState.ts
CHANGED
|
@@ -37,6 +37,10 @@ import {
|
|
|
37
37
|
import { action, flow, flowResult, makeObservable, observable } from 'mobx';
|
|
38
38
|
import type { EditorStore } from '../../EditorStore.js';
|
|
39
39
|
import { LEGEND_STUDIO_APP_EVENT } from '../../../../__lib__/LegendStudioEvent.js';
|
|
40
|
+
import {
|
|
41
|
+
GENERATION_MODE,
|
|
42
|
+
LegendStudioTelemetryHelper,
|
|
43
|
+
} from '../../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
40
44
|
import { GENERATION_FILE_ROOT_NAME } from '../../utils/FileSystemTreeUtils.js';
|
|
41
45
|
import {
|
|
42
46
|
configurationProperty_addConfigurationProperty,
|
|
@@ -99,6 +103,22 @@ export class XTGenerationState extends GeneratedFileStructureState {
|
|
|
99
103
|
|
|
100
104
|
*generate(): GeneratorFn<void> {
|
|
101
105
|
this.generatingAction.inProgress();
|
|
106
|
+
const startedAt = Date.now();
|
|
107
|
+
const sourceInfo = this.editorStore.editorMode.getSourceInfo();
|
|
108
|
+
const generationType = this.elementXTSchemaGenerationState.description.name;
|
|
109
|
+
const elementPath =
|
|
110
|
+
this.configSpecification.modelUnit.packageableElementIncludes[0]?.value
|
|
111
|
+
.path;
|
|
112
|
+
const telemetryBase = {
|
|
113
|
+
mode: GENERATION_MODE.ELEMENT_SCHEMA,
|
|
114
|
+
elementPath,
|
|
115
|
+
generationType,
|
|
116
|
+
};
|
|
117
|
+
LegendStudioTelemetryHelper.logEvent_GenerationLaunched(
|
|
118
|
+
this.editorStore.applicationStore.telemetryService,
|
|
119
|
+
sourceInfo,
|
|
120
|
+
telemetryBase,
|
|
121
|
+
);
|
|
102
122
|
try {
|
|
103
123
|
const modelUnit = this.configSpecification.modelUnit;
|
|
104
124
|
const properties = [...this.configSpecification.configurationProperties];
|
|
@@ -122,6 +142,11 @@ export class XTGenerationState extends GeneratedFileStructureState {
|
|
|
122
142
|
)
|
|
123
143
|
.flat();
|
|
124
144
|
this.processGenerationResult(output);
|
|
145
|
+
LegendStudioTelemetryHelper.logEvent_GenerationSucceeded(
|
|
146
|
+
this.editorStore.applicationStore.telemetryService,
|
|
147
|
+
sourceInfo,
|
|
148
|
+
{ ...telemetryBase, durationMs: Date.now() - startedAt },
|
|
149
|
+
);
|
|
125
150
|
} catch (error) {
|
|
126
151
|
assertErrorThrown(error);
|
|
127
152
|
this.fileSystemState.selectedNode = undefined;
|
|
@@ -130,6 +155,11 @@ export class XTGenerationState extends GeneratedFileStructureState {
|
|
|
130
155
|
LogEvent.create(LEGEND_STUDIO_APP_EVENT.GENERATION_FAILURE),
|
|
131
156
|
error,
|
|
132
157
|
);
|
|
158
|
+
LegendStudioTelemetryHelper.logEvent_GenerationFailure(
|
|
159
|
+
this.editorStore.applicationStore.telemetryService,
|
|
160
|
+
sourceInfo,
|
|
161
|
+
{ ...telemetryBase, errorMessage: error.message },
|
|
162
|
+
);
|
|
133
163
|
this.editorStore.applicationStore.notificationService.notifyError(error);
|
|
134
164
|
} finally {
|
|
135
165
|
this.generatingAction.complete();
|
|
@@ -68,7 +68,9 @@ import {
|
|
|
68
68
|
isStubbed_StoreConnections,
|
|
69
69
|
getAllIdentifiedConnections,
|
|
70
70
|
generateIdentifiedConnectionId,
|
|
71
|
+
type LakehouseBaseRuntime,
|
|
71
72
|
LakehouseRuntime,
|
|
73
|
+
LakehouseSingleStoreRuntime,
|
|
72
74
|
ConcreteFunctionDefinition,
|
|
73
75
|
} from '@finos/legend-graph';
|
|
74
76
|
import type { DSL_Mapping_LegendStudioApplicationPlugin_Extension } from '../../../extensions/DSL_Mapping_LegendStudioApplicationPlugin_Extension.js';
|
|
@@ -899,42 +901,36 @@ export enum LakehouseRuntimeType {
|
|
|
899
901
|
CONNECTION = 'CONNECTION',
|
|
900
902
|
}
|
|
901
903
|
|
|
902
|
-
export class
|
|
903
|
-
|
|
904
|
+
export abstract class LakehouseBaseRuntimeEditorState extends EngineRuntimeEditorState {
|
|
905
|
+
/**
|
|
906
|
+
* NOTE: a fresh instance is built by `RuntimeEditorState.setRuntimeValueEditorState`
|
|
907
|
+
* whenever the compute engine swap replaces the concrete runtime class, so this
|
|
908
|
+
* changes exactly when that swap happens -- used to force a remount of the
|
|
909
|
+
* compute-engine-specific fields (e.g. Warehouse) in the UI.
|
|
910
|
+
*/
|
|
911
|
+
readonly uuid = uuid();
|
|
912
|
+
declare runtimeValue: LakehouseBaseRuntime;
|
|
904
913
|
availableEnvs: IngestDeploymentServerConfig[] | undefined;
|
|
914
|
+
/**
|
|
915
|
+
* Only `LakehouseRuntime` can switch out of environment mode today; a
|
|
916
|
+
* subclass whose runtime gains connection support just needs to set this.
|
|
917
|
+
*/
|
|
905
918
|
lakehouseRuntimeType = LakehouseRuntimeType.ENVIRONMENT;
|
|
906
919
|
|
|
907
|
-
constructor(state: RuntimeEditorState, value:
|
|
920
|
+
constructor(state: RuntimeEditorState, value: LakehouseBaseRuntime) {
|
|
908
921
|
super(state, value);
|
|
909
922
|
makeObservable(this, {
|
|
910
923
|
availableEnvs: observable,
|
|
924
|
+
lakehouseRuntimeType: observable,
|
|
911
925
|
fetchLakehouseSummaries: flow,
|
|
912
926
|
setEnvSummaries: action,
|
|
913
|
-
lakehouseRuntimeType: observable,
|
|
914
|
-
setLakehouseRuntimeType: action,
|
|
915
927
|
envOptions: computed,
|
|
916
928
|
});
|
|
917
929
|
this.runtimeValue = value;
|
|
918
|
-
// fix when metamodel is more clear on this
|
|
919
|
-
if (value.connectionPointer) {
|
|
920
|
-
this.lakehouseRuntimeType = LakehouseRuntimeType.CONNECTION;
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
|
|
924
|
-
setLakehouseRuntimeType(val: LakehouseRuntimeType): void {
|
|
925
|
-
if (val !== this.lakehouseRuntimeType) {
|
|
926
|
-
this.lakehouseRuntimeType = val;
|
|
927
|
-
if (val === LakehouseRuntimeType.CONNECTION) {
|
|
928
|
-
this.runtimeValue.environment = undefined;
|
|
929
|
-
this.runtimeValue.warehouse = undefined;
|
|
930
|
-
} else {
|
|
931
|
-
this.setConnection(undefined);
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
930
|
}
|
|
935
931
|
|
|
936
|
-
|
|
937
|
-
|
|
932
|
+
protected get isEnvironmentModeActive(): boolean {
|
|
933
|
+
return this.lakehouseRuntimeType === LakehouseRuntimeType.ENVIRONMENT;
|
|
938
934
|
}
|
|
939
935
|
|
|
940
936
|
get envOptions(): { label: string; value: string }[] {
|
|
@@ -972,7 +968,7 @@ export class LakehouseRuntimeEditorState extends EngineRuntimeEditorState {
|
|
|
972
968
|
)) as unknown as IngestDeploymentServerConfig[] | undefined;
|
|
973
969
|
this.setEnvSummaries(res);
|
|
974
970
|
if (
|
|
975
|
-
this.
|
|
971
|
+
this.isEnvironmentModeActive &&
|
|
976
972
|
!this.runtimeValue.environment &&
|
|
977
973
|
this.envOptions.length
|
|
978
974
|
) {
|
|
@@ -985,6 +981,40 @@ export class LakehouseRuntimeEditorState extends EngineRuntimeEditorState {
|
|
|
985
981
|
}
|
|
986
982
|
}
|
|
987
983
|
|
|
984
|
+
export class LakehouseSingleStoreRuntimeEditorState extends LakehouseBaseRuntimeEditorState {
|
|
985
|
+
declare runtimeValue: LakehouseSingleStoreRuntime;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
export class LakehouseRuntimeEditorState extends LakehouseBaseRuntimeEditorState {
|
|
989
|
+
declare runtimeValue: LakehouseRuntime;
|
|
990
|
+
|
|
991
|
+
constructor(state: RuntimeEditorState, value: LakehouseRuntime) {
|
|
992
|
+
super(state, value);
|
|
993
|
+
makeObservable(this, {
|
|
994
|
+
setLakehouseRuntimeType: action,
|
|
995
|
+
});
|
|
996
|
+
if (value.connectionPointer) {
|
|
997
|
+
this.lakehouseRuntimeType = LakehouseRuntimeType.CONNECTION;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
setLakehouseRuntimeType(val: LakehouseRuntimeType): void {
|
|
1002
|
+
if (val !== this.lakehouseRuntimeType) {
|
|
1003
|
+
this.lakehouseRuntimeType = val;
|
|
1004
|
+
if (val === LakehouseRuntimeType.CONNECTION) {
|
|
1005
|
+
this.runtimeValue.environment = undefined;
|
|
1006
|
+
this.runtimeValue.warehouse = undefined;
|
|
1007
|
+
} else {
|
|
1008
|
+
this.setConnection(undefined);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
setConnection(val: PackageableConnection | undefined): void {
|
|
1014
|
+
lakehouseRuntime_setConnection(this.runtimeValue, val);
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
988
1018
|
export class RuntimeEditorState {
|
|
989
1019
|
/**
|
|
990
1020
|
* NOTE: used to force component remount on state change
|
|
@@ -1002,20 +1032,51 @@ export class RuntimeEditorState {
|
|
|
1002
1032
|
) {
|
|
1003
1033
|
makeObservable(this, {
|
|
1004
1034
|
runtimeValueEditorState: observable,
|
|
1035
|
+
setRuntimeValueEditorState: action,
|
|
1005
1036
|
});
|
|
1006
1037
|
|
|
1007
1038
|
this.editorStore = editorStore;
|
|
1008
1039
|
this.runtime = runtime;
|
|
1009
1040
|
this.isEmbeddedRuntime = isEmbeddedRuntime;
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1041
|
+
this.runtimeValueEditorState = this.buildRuntimeValueEditorState(
|
|
1042
|
+
this.resolveRuntimeValue(),
|
|
1043
|
+
);
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
private resolveRuntimeValue(): EngineRuntime {
|
|
1047
|
+
return this.runtime instanceof RuntimePointer
|
|
1048
|
+
? this.runtime.packageableRuntime.value.runtimeValue
|
|
1049
|
+
: guaranteeType(this.runtime, EngineRuntime);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
private buildRuntimeValueEditorState(
|
|
1053
|
+
runtimeValue: EngineRuntime,
|
|
1054
|
+
): EngineRuntimeEditorState {
|
|
1055
|
+
return runtimeValue instanceof LakehouseRuntime
|
|
1056
|
+
? new LakehouseRuntimeEditorState(this, runtimeValue)
|
|
1057
|
+
: runtimeValue instanceof LakehouseSingleStoreRuntime
|
|
1058
|
+
? new LakehouseSingleStoreRuntimeEditorState(this, runtimeValue)
|
|
1017
1059
|
: new EngineRuntimeEditorState(this, runtimeValue);
|
|
1018
1060
|
}
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Rebuilds the concrete runtime-value editor state after the underlying
|
|
1064
|
+
* runtime's concrete type changes in place (e.g. Lakehouse compute-engine
|
|
1065
|
+
* swap between `LakehouseRuntime` and `LakehouseSingleStoreRuntime`).
|
|
1066
|
+
* Carries over already-fetched Lakehouse environment options so callers
|
|
1067
|
+
* don't need to refetch (which requires an auth token round-trip).
|
|
1068
|
+
*/
|
|
1069
|
+
setRuntimeValueEditorState(runtimeValue: EngineRuntime): void {
|
|
1070
|
+
const previous = this.runtimeValueEditorState;
|
|
1071
|
+
const next = this.buildRuntimeValueEditorState(runtimeValue);
|
|
1072
|
+
if (
|
|
1073
|
+
previous instanceof LakehouseBaseRuntimeEditorState &&
|
|
1074
|
+
next instanceof LakehouseBaseRuntimeEditorState
|
|
1075
|
+
) {
|
|
1076
|
+
next.setEnvSummaries(previous.availableEnvs);
|
|
1077
|
+
}
|
|
1078
|
+
this.runtimeValueEditorState = next;
|
|
1079
|
+
}
|
|
1019
1080
|
}
|
|
1020
1081
|
|
|
1021
1082
|
export class PackageableRuntimeEditorState extends ElementEditorState {
|
|
@@ -50,6 +50,7 @@ import {
|
|
|
50
50
|
TestableTestEditorState,
|
|
51
51
|
TestableTestSuiteEditorState,
|
|
52
52
|
} from '../../testable/TestableEditorState.js';
|
|
53
|
+
import { TESTABLE_KIND } from '../../../../../../__lib__/LegendStudioTelemetryHelper.js';
|
|
53
54
|
import { RelationElementState } from '../../data/EmbeddedDataState.js';
|
|
54
55
|
import { atomicTest_addAssertion } from '../../../../../graph-modifier/Testable_GraphModifierHelper.js';
|
|
55
56
|
import { externalFormatData_setData } from '../../../../../graph-modifier/DSL_Data_GraphModifierHelper.js';
|
|
@@ -345,6 +346,14 @@ export class AvailabilityTestState extends TestableTestEditorState {
|
|
|
345
346
|
readonly suiteState: AvailabilityTestSuiteState;
|
|
346
347
|
override test: AvailabilityBarrierTest;
|
|
347
348
|
|
|
349
|
+
override get testableKind(): TESTABLE_KIND {
|
|
350
|
+
return TESTABLE_KIND.AVAILABILITY;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
override get testablePath(): string {
|
|
354
|
+
return this.suiteState.testableState.availability.path;
|
|
355
|
+
}
|
|
356
|
+
|
|
348
357
|
constructor(
|
|
349
358
|
suiteState: AvailabilityTestSuiteState,
|
|
350
359
|
test: AvailabilityBarrierTest,
|
|
@@ -436,6 +445,14 @@ export class AvailabilityTestSuiteState extends TestableTestSuiteEditorState {
|
|
|
436
445
|
testToRename: AvailabilityBarrierTest | undefined;
|
|
437
446
|
readonly testDataState: RelationElementState;
|
|
438
447
|
|
|
448
|
+
override get testableKind(): TESTABLE_KIND {
|
|
449
|
+
return TESTABLE_KIND.AVAILABILITY;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
override get testablePath(): string {
|
|
453
|
+
return this.testableState.availability.path;
|
|
454
|
+
}
|
|
455
|
+
|
|
439
456
|
constructor(
|
|
440
457
|
testableState: AvailabilityTestableState,
|
|
441
458
|
suite: AvailabilityTestSuite,
|
package/src/stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.ts
CHANGED
|
@@ -49,7 +49,6 @@ import {
|
|
|
49
49
|
type ExecutionResultWithMetadata,
|
|
50
50
|
TDSExecutionResult,
|
|
51
51
|
getColumn,
|
|
52
|
-
PrimitiveType,
|
|
53
52
|
PRIMITIVE_TYPE,
|
|
54
53
|
TDSRow,
|
|
55
54
|
type Schema,
|
|
@@ -105,7 +104,7 @@ const buildTableToTDSQueryNonNumericWithColumnGrammar = (
|
|
|
105
104
|
const db = table.schema._OWNER.path;
|
|
106
105
|
const PREVIEW_COLUMN_NAME = 'Count Value';
|
|
107
106
|
const columnGetter = getTDSColumnDerivedProperyFromType(
|
|
108
|
-
getPrimitiveTypeFromRelationalType(column.type)
|
|
107
|
+
getPrimitiveTypeFromRelationalType(column.type),
|
|
109
108
|
);
|
|
110
109
|
return `|${db}->tableReference(
|
|
111
110
|
'${schemaName}',
|
|
@@ -135,7 +134,7 @@ const buildTableToTDSQueryNumericWithColumnGrammar = (
|
|
|
135
134
|
const schemaName = table.schema.name;
|
|
136
135
|
const db = table.schema._OWNER.path;
|
|
137
136
|
const columnGetter = getTDSColumnDerivedProperyFromType(
|
|
138
|
-
getPrimitiveTypeFromRelationalType(column.type)
|
|
137
|
+
getPrimitiveTypeFromRelationalType(column.type),
|
|
139
138
|
);
|
|
140
139
|
return `|${db}->tableReference(
|
|
141
140
|
'${schemaName}',
|
|
@@ -181,9 +180,10 @@ const buildTableToTDSQueryNumericWithColumnGrammar = (
|
|
|
181
180
|
)`;
|
|
182
181
|
};
|
|
183
182
|
|
|
184
|
-
const buildTableToTDSQueryColumnQuery = (
|
|
185
|
-
|
|
186
|
-
|
|
183
|
+
export const buildTableToTDSQueryColumnQuery = (
|
|
184
|
+
column: Column,
|
|
185
|
+
): [string, boolean] => {
|
|
186
|
+
const type = getPrimitiveTypeFromRelationalType(column.type);
|
|
187
187
|
const numerics = [
|
|
188
188
|
PRIMITIVE_TYPE.NUMBER,
|
|
189
189
|
PRIMITIVE_TYPE.INTEGER,
|
package/src/stores/editor/editor-state/element-editor-state/dataProduct/DataProductEditorState.ts
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
AccessPoint,
|
|
31
31
|
AccessPointGroup,
|
|
32
32
|
CodeCompletionResult,
|
|
33
|
+
CompilationError,
|
|
33
34
|
DataElement,
|
|
34
35
|
DataElementReference,
|
|
35
36
|
DataProduct,
|
|
@@ -136,7 +137,18 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
136
137
|
readonly editorStore: EditorStore;
|
|
137
138
|
readonly val: LakehouseAccessPointState;
|
|
138
139
|
lambdaRelationColumns: string[] | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* The engine's error message for this access point's lambda, when the engine
|
|
142
|
+
* answered that it could not compute the lambda's relation type.
|
|
143
|
+
*/
|
|
144
|
+
lambdaRelationTypeError: string | undefined;
|
|
139
145
|
isUpdatingRelationColumns = false;
|
|
146
|
+
/**
|
|
147
|
+
* Hash of the lambda the engine last answered for, with either its relation
|
|
148
|
+
* columns or an error for this lambda. A failure that is not an answer for
|
|
149
|
+
* this lambda (network, whole-batch failure) must leave it unset, so the next
|
|
150
|
+
* update asks the engine again.
|
|
151
|
+
*/
|
|
140
152
|
lastComputedLambdaHash: string | undefined;
|
|
141
153
|
lastComputedLambdaString: string | undefined;
|
|
142
154
|
|
|
@@ -149,8 +161,10 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
149
161
|
|
|
150
162
|
makeObservable(this, {
|
|
151
163
|
lambdaRelationColumns: observable,
|
|
164
|
+
lambdaRelationTypeError: observable,
|
|
152
165
|
isUpdatingRelationColumns: observable,
|
|
153
166
|
setLambdaRelationColumns: action,
|
|
167
|
+
setLambdaRelationTypeError: action,
|
|
154
168
|
updateLambdaRelationColumns: flow,
|
|
155
169
|
});
|
|
156
170
|
}
|
|
@@ -159,6 +173,10 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
159
173
|
this.lambdaRelationColumns = columns;
|
|
160
174
|
}
|
|
161
175
|
|
|
176
|
+
setLambdaRelationTypeError(message: string | undefined): void {
|
|
177
|
+
this.lambdaRelationTypeError = message;
|
|
178
|
+
}
|
|
179
|
+
|
|
162
180
|
setIsUpdatingRelationColumns(value: boolean): void {
|
|
163
181
|
this.isUpdatingRelationColumns = value;
|
|
164
182
|
}
|
|
@@ -174,6 +192,7 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
174
192
|
}
|
|
175
193
|
|
|
176
194
|
this.setIsUpdatingRelationColumns(true);
|
|
195
|
+
this.setLambdaRelationTypeError(undefined);
|
|
177
196
|
try {
|
|
178
197
|
const relationType =
|
|
179
198
|
(yield this.editorStore.graphManagerState.graphManager.getLambdaRelationType(
|
|
@@ -183,10 +202,22 @@ export class AccessPointLambdaEditorState extends LambdaEditorState {
|
|
|
183
202
|
this.setLambdaRelationColumns(
|
|
184
203
|
relationType.columns.map((column) => column.name),
|
|
185
204
|
);
|
|
186
|
-
|
|
205
|
+
this.lastComputedLambdaHash = lambdaHash;
|
|
206
|
+
} catch (error) {
|
|
207
|
+
assertErrorThrown(error);
|
|
187
208
|
this.setLambdaRelationColumns(undefined);
|
|
209
|
+
if (error instanceof CompilationError) {
|
|
210
|
+
// the engine compiled this lambda and answered with an error for it
|
|
211
|
+
this.setLambdaRelationTypeError(error.message);
|
|
212
|
+
this.lastComputedLambdaHash = lambdaHash;
|
|
213
|
+
} else {
|
|
214
|
+
this.editorStore.applicationStore.logService.error(
|
|
215
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_MANAGER_FAILURE),
|
|
216
|
+
`Can't get relation type for access point '${this.val.accessPoint.id}'`,
|
|
217
|
+
error,
|
|
218
|
+
);
|
|
219
|
+
}
|
|
188
220
|
} finally {
|
|
189
|
-
this.lastComputedLambdaHash = lambdaHash;
|
|
190
221
|
this.setIsUpdatingRelationColumns(false);
|
|
191
222
|
}
|
|
192
223
|
}
|
|
@@ -363,7 +394,10 @@ export class LakehouseAccessPointState extends AccessPointState {
|
|
|
363
394
|
const lambdaColumns = this.lambdaState.lambdaRelationColumns;
|
|
364
395
|
|
|
365
396
|
if (lambdaColumns === undefined) {
|
|
366
|
-
|
|
397
|
+
const engineError = this.lambdaState.lambdaRelationTypeError;
|
|
398
|
+
return `Fix compiler errors and make sure AccessPoint ${this.accessPoint.id} returns a Relation type${
|
|
399
|
+
engineError ? `. Engine error: ${engineError}` : ''
|
|
400
|
+
}`;
|
|
367
401
|
}
|
|
368
402
|
|
|
369
403
|
return `Sample values columns must match: [${lambdaColumns.join(', ')}]`;
|
|
@@ -931,9 +965,10 @@ export class DataProductEditorState extends ElementEditorState {
|
|
|
931
965
|
if (entries.length === 0) {
|
|
932
966
|
return;
|
|
933
967
|
}
|
|
934
|
-
entries.forEach((entry) =>
|
|
935
|
-
entry.apState.lambdaState.setIsUpdatingRelationColumns(true)
|
|
936
|
-
|
|
968
|
+
entries.forEach((entry) => {
|
|
969
|
+
entry.apState.lambdaState.setIsUpdatingRelationColumns(true);
|
|
970
|
+
entry.apState.lambdaState.setLambdaRelationTypeError(undefined);
|
|
971
|
+
});
|
|
937
972
|
try {
|
|
938
973
|
const lambdas = new Map<string, RawLambda>(
|
|
939
974
|
entries.map((entry) => [
|
|
@@ -941,28 +976,51 @@ export class DataProductEditorState extends ElementEditorState {
|
|
|
941
976
|
entry.apState.accessPoint.func,
|
|
942
977
|
]),
|
|
943
978
|
);
|
|
944
|
-
const { results } =
|
|
979
|
+
const { results, errors } =
|
|
945
980
|
(yield this.editorStore.graphManagerState.graphManager.getBatchLambdasRelationType(
|
|
946
981
|
lambdas,
|
|
947
982
|
this.editorStore.graphManagerState.graph,
|
|
948
983
|
)) as BatchLambdasRelationTypeResult;
|
|
949
984
|
entries.forEach((entry) => {
|
|
985
|
+
const lambdaState = entry.apState.lambdaState;
|
|
950
986
|
const relationType = results.get(entry.apState.uuid);
|
|
951
|
-
entry.apState.
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
987
|
+
const engineError = errors.get(entry.apState.uuid);
|
|
988
|
+
if (relationType) {
|
|
989
|
+
lambdaState.setLambdaRelationColumns(
|
|
990
|
+
relationType.columns.map((column) => column.name),
|
|
991
|
+
);
|
|
992
|
+
lambdaState.lastComputedLambdaHash = entry.hash;
|
|
993
|
+
} else if (engineError) {
|
|
994
|
+
// the engine answered with an error for this lambda
|
|
995
|
+
lambdaState.setLambdaRelationColumns(undefined);
|
|
996
|
+
lambdaState.setLambdaRelationTypeError(engineError.message);
|
|
997
|
+
lambdaState.lastComputedLambdaHash = entry.hash;
|
|
998
|
+
} else {
|
|
999
|
+
// the engine did not answer for this lambda: leave the hash unset so
|
|
1000
|
+
// the next update asks again
|
|
1001
|
+
lambdaState.setLambdaRelationColumns(undefined);
|
|
1002
|
+
this.editorStore.applicationStore.logService.error(
|
|
1003
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_MANAGER_FAILURE),
|
|
1004
|
+
`Engine returned neither a relation type nor an error for access point '${entry.apState.accessPoint.id}'`,
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
956
1007
|
});
|
|
957
|
-
} catch {
|
|
1008
|
+
} catch (error) {
|
|
1009
|
+
assertErrorThrown(error);
|
|
1010
|
+
// the whole batch failed, so no access point got an answer: leave their
|
|
1011
|
+
// hashes unset so the next update asks again
|
|
1012
|
+
this.editorStore.applicationStore.logService.error(
|
|
1013
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.GRAPH_MANAGER_FAILURE),
|
|
1014
|
+
`Can't get relation types for access points`,
|
|
1015
|
+
error,
|
|
1016
|
+
);
|
|
958
1017
|
entries.forEach((entry) =>
|
|
959
1018
|
entry.apState.lambdaState.setLambdaRelationColumns(undefined),
|
|
960
1019
|
);
|
|
961
1020
|
} finally {
|
|
962
|
-
entries.forEach((entry) =>
|
|
963
|
-
entry.apState.lambdaState.
|
|
964
|
-
|
|
965
|
-
});
|
|
1021
|
+
entries.forEach((entry) =>
|
|
1022
|
+
entry.apState.lambdaState.setIsUpdatingRelationColumns(false),
|
|
1023
|
+
);
|
|
966
1024
|
}
|
|
967
1025
|
}
|
|
968
1026
|
|