@finos/legend-extension-dsl-data-quality 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +1 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.d.ts +46 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.js +116 -0
- package/lib/components/DSL_DataQuality_ClassElementDriver.js.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.d.ts +30 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.js +161 -0
- package/lib/components/DSL_DataQuality_LegendStudioApplicationPlugin.js.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.d.ts +25 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.js +2 -0
- package/lib/components/DSL_DataQuality_LegendStudioPlugin_Extension.js.map +1 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.d.ts +27 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.d.ts.map +1 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.js +41 -0
- package/lib/components/DSL_DataQuality_ServiceElementDriver.js.map +1 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.d.ts +19 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.d.ts.map +1 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.js +64 -0
- package/lib/components/DSL_NewDataQualityClassValidationElement.js.map +1 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.d.ts +19 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.d.ts.map +1 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.js +41 -0
- package/lib/components/DSL_NewDataQualityServiceValidationElement.js.map +1 -0
- package/lib/components/DataQualityClassValidationEditor.d.ts +19 -0
- package/lib/components/DataQualityClassValidationEditor.d.ts.map +1 -0
- package/lib/components/DataQualityClassValidationEditor.js +29 -0
- package/lib/components/DataQualityClassValidationEditor.js.map +1 -0
- package/lib/components/DataQualityConstraintsSelection.d.ts +39 -0
- package/lib/components/DataQualityConstraintsSelection.d.ts.map +1 -0
- package/lib/components/DataQualityConstraintsSelection.js +133 -0
- package/lib/components/DataQualityConstraintsSelection.js.map +1 -0
- package/lib/components/DataQualityDataSpaceBuilder.d.ts +22 -0
- package/lib/components/DataQualityDataSpaceBuilder.d.ts.map +1 -0
- package/lib/components/DataQualityDataSpaceBuilder.js +101 -0
- package/lib/components/DataQualityDataSpaceBuilder.js.map +1 -0
- package/lib/components/DataQualityExplorerPanel.d.ts +29 -0
- package/lib/components/DataQualityExplorerPanel.d.ts.map +1 -0
- package/lib/components/DataQualityExplorerPanel.js +185 -0
- package/lib/components/DataQualityExplorerPanel.js.map +1 -0
- package/lib/components/DataQualityFilterPanel.d.ts +24 -0
- package/lib/components/DataQualityFilterPanel.d.ts.map +1 -0
- package/lib/components/DataQualityFilterPanel.js +32 -0
- package/lib/components/DataQualityFilterPanel.js.map +1 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.d.ts +22 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.d.ts.map +1 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.js +98 -0
- package/lib/components/DataQualityMappingAndRuntimeBuilder.js.map +1 -0
- package/lib/components/DataQualityResultPanel.d.ts +22 -0
- package/lib/components/DataQualityResultPanel.d.ts.map +1 -0
- package/lib/components/DataQualityResultPanel.js +110 -0
- package/lib/components/DataQualityResultPanel.js.map +1 -0
- package/lib/components/DataQualityResultValues.d.ts +24 -0
- package/lib/components/DataQualityResultValues.d.ts.map +1 -0
- package/lib/components/DataQualityResultValues.js +31 -0
- package/lib/components/DataQualityResultValues.js.map +1 -0
- package/lib/components/DataQualityServiceValidationEditor.d.ts +19 -0
- package/lib/components/DataQualityServiceValidationEditor.d.ts.map +1 -0
- package/lib/components/DataQualityServiceValidationEditor.js +29 -0
- package/lib/components/DataQualityServiceValidationEditor.js.map +1 -0
- package/lib/components/DataQualitySideBar.d.ts +40 -0
- package/lib/components/DataQualitySideBar.d.ts.map +1 -0
- package/lib/components/DataQualitySideBar.js +78 -0
- package/lib/components/DataQualitySideBar.js.map +1 -0
- package/lib/components/DataQualityStructuralValidationsPanel.d.ts +22 -0
- package/lib/components/DataQualityStructuralValidationsPanel.d.ts.map +1 -0
- package/lib/components/DataQualityStructuralValidationsPanel.js +50 -0
- package/lib/components/DataQualityStructuralValidationsPanel.js.map +1 -0
- package/lib/components/DataQualityTabs.d.ts +22 -0
- package/lib/components/DataQualityTabs.d.ts.map +1 -0
- package/lib/components/DataQualityTabs.js +58 -0
- package/lib/components/DataQualityTabs.js.map +1 -0
- package/lib/components/DataQualityValidationEditor.d.ts +23 -0
- package/lib/components/DataQualityValidationEditor.d.ts.map +1 -0
- package/lib/components/DataQualityValidationEditor.js +24 -0
- package/lib/components/DataQualityValidationEditor.js.map +1 -0
- package/lib/components/constants/DataQualityConstants.d.ts +24 -0
- package/lib/components/constants/DataQualityConstants.d.ts.map +1 -0
- package/lib/components/constants/DataQualityConstants.js +25 -0
- package/lib/components/constants/DataQualityConstants.js.map +1 -0
- package/lib/components/index.d.ts +19 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +19 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/states/ConstraintState.d.ts +30 -0
- package/lib/components/states/ConstraintState.d.ts.map +1 -0
- package/lib/components/states/ConstraintState.js +55 -0
- package/lib/components/states/ConstraintState.js.map +1 -0
- package/lib/components/states/DataQualityClassValidationState.d.ts +43 -0
- package/lib/components/states/DataQualityClassValidationState.d.ts.map +1 -0
- package/lib/components/states/DataQualityClassValidationState.js +162 -0
- package/lib/components/states/DataQualityClassValidationState.js.map +1 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.d.ts +34 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.d.ts.map +1 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.js +70 -0
- package/lib/components/states/DataQualityGraphFetchTreeState.js.map +1 -0
- package/lib/components/states/DataQualityQueryBuilderState.d.ts +19 -0
- package/lib/components/states/DataQualityQueryBuilderState.d.ts.map +1 -0
- package/lib/components/states/DataQualityQueryBuilderState.js +19 -0
- package/lib/components/states/DataQualityQueryBuilderState.js.map +1 -0
- package/lib/components/states/DataQualityResultState.d.ts +44 -0
- package/lib/components/states/DataQualityResultState.d.ts.map +1 -0
- package/lib/components/states/DataQualityResultState.js +154 -0
- package/lib/components/states/DataQualityResultState.js.map +1 -0
- package/lib/components/states/DataQualityServiceValidationState.d.ts +25 -0
- package/lib/components/states/DataQualityServiceValidationState.d.ts.map +1 -0
- package/lib/components/states/DataQualityServiceValidationState.js +33 -0
- package/lib/components/states/DataQualityServiceValidationState.js.map +1 -0
- package/lib/components/states/DataQualityState.d.ts +67 -0
- package/lib/components/states/DataQualityState.d.ts.map +1 -0
- package/lib/components/states/DataQualityState.js +204 -0
- package/lib/components/states/DataQualityState.js.map +1 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.d.ts +51 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.d.ts.map +1 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.js +321 -0
- package/lib/components/utils/DataQualityGraphFetchTreeUtil.js.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.d.ts +29 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.d.ts.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.js +30 -0
- package/lib/graph/metamodel/DSL_DataQuality_HashUtils.js.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.d.ts +22 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.d.ts.map +1 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.js +31 -0
- package/lib/graph/metamodel/DSL_DataQuality_PureGraphPlugin.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.d.ts +26 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.js +44 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.js.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.d.ts +47 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.d.ts.map +1 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.js +75 -0
- package/lib/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.d.ts +20 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.js +20 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerHelper.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.d.ts +20 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.js +30 -0
- package/lib/graph-manager/DSL_DataQuality_GraphManagerPreset.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.d.ts +26 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.js +57 -0
- package/lib/graph-manager/DSL_DataQuality_GraphModifierHelper.js.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.d.ts +7 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.d.ts.map +1 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.js +42 -0
- package/lib/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.js.map +1 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.d.ts +24 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.d.ts.map +1 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.js +98 -0
- package/lib/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.js.map +1 -0
- package/lib/graph-manager/index.d.ts +19 -0
- package/lib/graph-manager/index.d.ts.map +1 -0
- package/lib/graph-manager/index.js +19 -0
- package/lib/graph-manager/index.js.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.js +21 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.js.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.d.ts +25 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.js +140 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.js.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.d.ts +18 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.js +20 -0
- package/lib/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.d.ts +41 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.js +95 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.d.ts +46 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.js +76 -0
- package/lib/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.js +32 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.js +31 -0
- package/lib/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.d.ts +24 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.js +92 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.js +56 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.js +70 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.d.ts +29 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.js +80 -0
- package/lib/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/package.json +87 -0
- package/package.json +87 -0
- package/src/components/DSL_DataQuality_ClassElementDriver.tsx +175 -0
- package/src/components/DSL_DataQuality_LegendStudioApplicationPlugin.tsx +220 -0
- package/src/components/DSL_DataQuality_LegendStudioPlugin_Extension.ts +39 -0
- package/src/components/DSL_DataQuality_ServiceElementDriver.tsx +57 -0
- package/src/components/DSL_NewDataQualityClassValidationElement.tsx +156 -0
- package/src/components/DSL_NewDataQualityServiceValidationElement.tsx +74 -0
- package/src/components/DataQualityClassValidationEditor.tsx +49 -0
- package/src/components/DataQualityConstraintsSelection.tsx +376 -0
- package/src/components/DataQualityDataSpaceBuilder.tsx +274 -0
- package/src/components/DataQualityExplorerPanel.tsx +584 -0
- package/src/components/DataQualityFilterPanel.tsx +50 -0
- package/src/components/DataQualityMappingAndRuntimeBuilder.tsx +224 -0
- package/src/components/DataQualityResultPanel.tsx +335 -0
- package/src/components/DataQualityResultValues.tsx +61 -0
- package/src/components/DataQualityServiceValidationEditor.tsx +49 -0
- package/src/components/DataQualitySideBar.tsx +216 -0
- package/src/components/DataQualityStructuralValidationsPanel.tsx +105 -0
- package/src/components/DataQualityTabs.tsx +104 -0
- package/src/components/DataQualityValidationEditor.tsx +52 -0
- package/src/components/constants/DataQualityConstants.ts +24 -0
- package/src/components/index.ts +19 -0
- package/src/components/states/ConstraintState.ts +70 -0
- package/src/components/states/DataQualityClassValidationState.ts +308 -0
- package/src/components/states/DataQualityGraphFetchTreeState.ts +125 -0
- package/src/components/states/DataQualityQueryBuilderState.ts +19 -0
- package/src/components/states/DataQualityResultState.ts +217 -0
- package/src/components/states/DataQualityServiceValidationState.ts +56 -0
- package/src/components/states/DataQualityState.ts +354 -0
- package/src/components/utils/DataQualityGraphFetchTreeUtil.ts +592 -0
- package/src/graph/metamodel/DSL_DataQuality_HashUtils.ts +29 -0
- package/src/graph/metamodel/DSL_DataQuality_PureGraphPlugin.ts +36 -0
- package/src/graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.ts +55 -0
- package/src/graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.ts +107 -0
- package/src/graph-manager/DSL_DataQuality_GraphManagerHelper.ts +46 -0
- package/src/graph-manager/DSL_DataQuality_GraphManagerPreset.ts +31 -0
- package/src/graph-manager/DSL_DataQuality_GraphModifierHelper.ts +113 -0
- package/src/graph-manager/DSL_DataQuality_PureGraphManagerPlugin.ts +59 -0
- package/src/graph-manager/action/changeDetection/DSL_DataQuality_ObserverHelper.ts +153 -0
- package/src/graph-manager/index.ts +19 -0
- package/src/graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.ts +59 -0
- package/src/graph-manager/protocol/pure/DSL_DataQuality_PureProtocolProcessorPlugin.ts +283 -0
- package/src/graph-manager/protocol/pure/DSL_DataQuality_buildGraphManagerExtension.ts +27 -0
- package/src/graph-manager/protocol/pure/v1/V1_DSL_Data_Quality_PureGraphManagerExtension.ts +246 -0
- package/src/graph-manager/protocol/pure/v1/V1_DataQualityConstraintsConfiguration.ts +103 -0
- package/src/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityPropertyGraphFetchTree.ts +37 -0
- package/src/graph-manager/protocol/pure/v1/model/graphFetch/V1_DataQualityRootGraphFetchTree.ts +36 -0
- package/src/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationBuilderHelper.ts +241 -0
- package/src/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationSerializer.ts +113 -0
- package/src/graph-manager/protocol/pure/v1/transformation/V1_ValueSpecificationTransformer.ts +139 -0
- package/src/graph-manager/protocol/pure/v1/transformation/pureProtocol/V1_DSL_DataQuality_ProtocolHelper.ts +186 -0
- package/style/_data-quality-validation-builder.scss +1660 -0
- package/style/index.scss +67 -0
- package/tsconfig.json +137 -0
- package/tsconfig.package.json +9 -0
@@ -0,0 +1,308 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { action, flow, makeObservable, observable } from 'mobx';
|
18
|
+
import {
|
19
|
+
type Class,
|
20
|
+
type Mapping,
|
21
|
+
type PackageableElement,
|
22
|
+
type Runtime,
|
23
|
+
getMappingCompatibleClasses,
|
24
|
+
PackageableElementExplicitReference,
|
25
|
+
RuntimePointer,
|
26
|
+
} from '@finos/legend-graph';
|
27
|
+
import type {
|
28
|
+
EditorStore,
|
29
|
+
ElementEditorState,
|
30
|
+
} from '@finos/legend-application-studio';
|
31
|
+
import {
|
32
|
+
DataQualityClassValidationsConfiguration,
|
33
|
+
DataSpaceDataQualityExecutionContext,
|
34
|
+
MappingAndRuntimeDataQualityExecutionContext,
|
35
|
+
} from '../../graph/metamodel/pure/packageableElements/data-quality/DataQualityValidationConfiguration.js';
|
36
|
+
import { DataQualityState } from './DataQualityState.js';
|
37
|
+
import {
|
38
|
+
type DataSpaceInfo,
|
39
|
+
type DataSpaceExecutionContext,
|
40
|
+
DataSpace,
|
41
|
+
resolveUsableDataSpaceClasses,
|
42
|
+
} from '@finos/legend-extension-dsl-data-space/graph';
|
43
|
+
import { ELEMENT_CREATION_BASIS } from '../DSL_DataQuality_ClassElementDriver.js';
|
44
|
+
import {
|
45
|
+
type GeneratorFn,
|
46
|
+
assertType,
|
47
|
+
filterByType,
|
48
|
+
getNullableFirstEntry,
|
49
|
+
guaranteeNonNullable,
|
50
|
+
guaranteeType,
|
51
|
+
} from '@finos/legend-shared';
|
52
|
+
import {
|
53
|
+
dataQualityClassValidation_setContextDataQualityContext,
|
54
|
+
dataQualityClassValidation_setDataQualityContext,
|
55
|
+
dataQualityClassValidation_setDataQualityGraphFetchTree,
|
56
|
+
dataQualityClassValidation_setFilter,
|
57
|
+
dataQualityClassValidation_setRuntimeDataQualityContext,
|
58
|
+
} from '../../graph-manager/DSL_DataQuality_GraphModifierHelper.js';
|
59
|
+
import { DataQualityGraphFetchTreeState } from './DataQualityGraphFetchTreeState.js';
|
60
|
+
import { DataQualityResultState } from './DataQualityResultState.js';
|
61
|
+
|
62
|
+
export class DataQualityClassValidationState extends DataQualityState {
|
63
|
+
dataSpace?: DataSpace | undefined;
|
64
|
+
dataSpaces: DataSpaceInfo[] = [];
|
65
|
+
validationElementCreationBasis: ELEMENT_CREATION_BASIS =
|
66
|
+
ELEMENT_CREATION_BASIS.MAPPING_RUNTIME_BASED;
|
67
|
+
|
68
|
+
constructor(
|
69
|
+
editorStore: EditorStore,
|
70
|
+
element: DataQualityClassValidationsConfiguration,
|
71
|
+
) {
|
72
|
+
super(editorStore, element);
|
73
|
+
makeObservable(this, {
|
74
|
+
dataSpaces: observable,
|
75
|
+
dataSpace: observable,
|
76
|
+
onDataSpaceChange: action,
|
77
|
+
initializeState: action,
|
78
|
+
updateElementOnMappingChange: action,
|
79
|
+
updateElementOnRuntimeChange: action,
|
80
|
+
updateElementOnExecutionContextChange: action,
|
81
|
+
updateElementOnDataSpaceChange: action,
|
82
|
+
loadDataSpaces: flow,
|
83
|
+
});
|
84
|
+
this.initializeState();
|
85
|
+
}
|
86
|
+
|
87
|
+
reprocess(
|
88
|
+
newElement: PackageableElement,
|
89
|
+
editorStore: EditorStore,
|
90
|
+
): ElementEditorState {
|
91
|
+
const element = guaranteeType(
|
92
|
+
newElement,
|
93
|
+
DataQualityClassValidationsConfiguration,
|
94
|
+
'Element inside data quality class validation editor state must be a class validation element',
|
95
|
+
);
|
96
|
+
|
97
|
+
return new DataQualityClassValidationState(editorStore, element);
|
98
|
+
}
|
99
|
+
|
100
|
+
override get constraintsConfigurationElement(): DataQualityClassValidationsConfiguration {
|
101
|
+
return guaranteeType(
|
102
|
+
this.element,
|
103
|
+
DataQualityClassValidationsConfiguration,
|
104
|
+
'Element inside data quality class validation state must be a data quality class validation configuration element',
|
105
|
+
);
|
106
|
+
}
|
107
|
+
|
108
|
+
initializeState() {
|
109
|
+
let classOptions: Class[] = [];
|
110
|
+
if (
|
111
|
+
this.constraintsConfigurationElement.context instanceof
|
112
|
+
MappingAndRuntimeDataQualityExecutionContext
|
113
|
+
) {
|
114
|
+
this.validationElementCreationBasis =
|
115
|
+
ELEMENT_CREATION_BASIS.MAPPING_RUNTIME_BASED;
|
116
|
+
this.dataQualityQueryBuilderState.executionContextState.setMapping(
|
117
|
+
this.constraintsConfigurationElement.context.mapping.value,
|
118
|
+
);
|
119
|
+
this.dataQualityQueryBuilderState.executionContextState.setRuntimeValue(
|
120
|
+
new RuntimePointer(
|
121
|
+
this.constraintsConfigurationElement.context.runtime,
|
122
|
+
),
|
123
|
+
);
|
124
|
+
classOptions = getMappingCompatibleClasses(
|
125
|
+
this.dataQualityQueryBuilderState.executionContextState.mapping!,
|
126
|
+
this.graphManagerState.usableClasses,
|
127
|
+
);
|
128
|
+
} else if (
|
129
|
+
this.constraintsConfigurationElement.context instanceof
|
130
|
+
DataSpaceDataQualityExecutionContext
|
131
|
+
) {
|
132
|
+
this.validationElementCreationBasis =
|
133
|
+
ELEMENT_CREATION_BASIS.DATASPACE_BASED;
|
134
|
+
this.dataSpace =
|
135
|
+
this.constraintsConfigurationElement.context.dataSpace.value;
|
136
|
+
this.executionContext = this.dataSpace.defaultExecutionContext;
|
137
|
+
this.dataQualityQueryBuilderState.executionContextState.setMapping(
|
138
|
+
this.dataSpace.defaultExecutionContext.mapping.value,
|
139
|
+
);
|
140
|
+
this.dataQualityQueryBuilderState.executionContextState.setRuntimeValue(
|
141
|
+
new RuntimePointer(
|
142
|
+
this.dataSpace.defaultExecutionContext.defaultRuntime,
|
143
|
+
),
|
144
|
+
);
|
145
|
+
classOptions = resolveUsableDataSpaceClasses(
|
146
|
+
this.dataSpace,
|
147
|
+
this.dataQualityQueryBuilderState.executionContextState.mapping!,
|
148
|
+
this.graphManagerState,
|
149
|
+
);
|
150
|
+
}
|
151
|
+
this.initializeGraphFetchTreeState(
|
152
|
+
this.constraintsConfigurationElement.dataQualityRootGraphFetchTree,
|
153
|
+
);
|
154
|
+
this.initializeFilterState(this.constraintsConfigurationElement.filter);
|
155
|
+
|
156
|
+
if (this.constraintsConfigurationElement.dataQualityRootGraphFetchTree) {
|
157
|
+
this.dataQualityQueryBuilderState.setClass(
|
158
|
+
this.constraintsConfigurationElement.dataQualityRootGraphFetchTree.class
|
159
|
+
.value,
|
160
|
+
);
|
161
|
+
} else {
|
162
|
+
this.dataQualityQueryBuilderState.setClass(
|
163
|
+
getNullableFirstEntry(classOptions),
|
164
|
+
);
|
165
|
+
this.dataQualityGraphFetchTreeState = new DataQualityGraphFetchTreeState(
|
166
|
+
this,
|
167
|
+
);
|
168
|
+
dataQualityClassValidation_setDataQualityGraphFetchTree(
|
169
|
+
this.constraintsConfigurationElement,
|
170
|
+
this.dataQualityGraphFetchTreeState.treeData
|
171
|
+
? this.dataQualityGraphFetchTreeState.treeData.tree
|
172
|
+
: undefined,
|
173
|
+
);
|
174
|
+
}
|
175
|
+
}
|
176
|
+
|
177
|
+
changeMapping(val: Mapping, options?: { keepQueryContent?: boolean }): void {
|
178
|
+
//reset result
|
179
|
+
this.dataQualityQueryBuilderState.executionContextState.setMapping(val);
|
180
|
+
this.dataQualityQueryBuilderState.executionContextState.setRuntimeValue(
|
181
|
+
undefined,
|
182
|
+
);
|
183
|
+
this.dataQualityQueryBuilderState.explorerState.setTreeData(undefined);
|
184
|
+
this.dataQualityQueryBuilderState.setClass(undefined);
|
185
|
+
this.dataQualityGraphFetchTreeState = new DataQualityGraphFetchTreeState(
|
186
|
+
this,
|
187
|
+
);
|
188
|
+
this.structuralValidationsGraphFetchTreeState =
|
189
|
+
new DataQualityGraphFetchTreeState(this);
|
190
|
+
this.resultState = new DataQualityResultState(this);
|
191
|
+
}
|
192
|
+
|
193
|
+
changeRuntime(val: Runtime) {
|
194
|
+
this.dataQualityQueryBuilderState.changeRuntime(val);
|
195
|
+
this.resultState = new DataQualityResultState(this);
|
196
|
+
}
|
197
|
+
|
198
|
+
updateElementOnMappingChange() {
|
199
|
+
const mappingAndRuntimeExecutionContext =
|
200
|
+
new MappingAndRuntimeDataQualityExecutionContext();
|
201
|
+
mappingAndRuntimeExecutionContext.mapping =
|
202
|
+
PackageableElementExplicitReference.create(
|
203
|
+
this.dataQualityQueryBuilderState.executionContextState.mapping!,
|
204
|
+
);
|
205
|
+
guaranteeNonNullable(
|
206
|
+
this.dataQualityQueryBuilderState.executionContextState.runtimeValue,
|
207
|
+
);
|
208
|
+
mappingAndRuntimeExecutionContext.runtime = (
|
209
|
+
this.dataQualityQueryBuilderState.executionContextState
|
210
|
+
.runtimeValue as RuntimePointer
|
211
|
+
).packageableRuntime;
|
212
|
+
dataQualityClassValidation_setDataQualityContext(
|
213
|
+
this.constraintsConfigurationElement,
|
214
|
+
mappingAndRuntimeExecutionContext,
|
215
|
+
);
|
216
|
+
dataQualityClassValidation_setDataQualityGraphFetchTree(
|
217
|
+
this.constraintsConfigurationElement,
|
218
|
+
undefined,
|
219
|
+
);
|
220
|
+
dataQualityClassValidation_setFilter(
|
221
|
+
this.constraintsConfigurationElement,
|
222
|
+
undefined,
|
223
|
+
);
|
224
|
+
}
|
225
|
+
|
226
|
+
updateElementOnRuntimeChange(runtime: Runtime) {
|
227
|
+
assertType(runtime, RuntimePointer);
|
228
|
+
dataQualityClassValidation_setRuntimeDataQualityContext(
|
229
|
+
this.constraintsConfigurationElement,
|
230
|
+
runtime.packageableRuntime,
|
231
|
+
this.editorStore.changeDetectionState.observerContext,
|
232
|
+
);
|
233
|
+
}
|
234
|
+
|
235
|
+
updateElementOnExecutionContextChange(context: string) {
|
236
|
+
dataQualityClassValidation_setContextDataQualityContext(
|
237
|
+
this.constraintsConfigurationElement,
|
238
|
+
context,
|
239
|
+
);
|
240
|
+
}
|
241
|
+
|
242
|
+
propagateExecutionContextChange(
|
243
|
+
executionContext: DataSpaceExecutionContext,
|
244
|
+
): void {
|
245
|
+
const mapping = executionContext.mapping.value;
|
246
|
+
this.changeMapping(mapping);
|
247
|
+
this.dataQualityQueryBuilderState.changeRuntime(
|
248
|
+
new RuntimePointer(executionContext.defaultRuntime),
|
249
|
+
);
|
250
|
+
const compatibleClasses = resolveUsableDataSpaceClasses(
|
251
|
+
this.dataSpace!,
|
252
|
+
mapping,
|
253
|
+
this.graphManagerState,
|
254
|
+
);
|
255
|
+
// if there is no chosen class or the chosen one is not compatible
|
256
|
+
// with the mapping then pick a compatible class if possible
|
257
|
+
if (
|
258
|
+
!this.dataQualityQueryBuilderState.class ||
|
259
|
+
!compatibleClasses.includes(this.dataQualityQueryBuilderState.class)
|
260
|
+
) {
|
261
|
+
const possibleNewClass = getNullableFirstEntry(compatibleClasses);
|
262
|
+
if (possibleNewClass) {
|
263
|
+
this.changeClass(possibleNewClass);
|
264
|
+
}
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
268
|
+
onDataSpaceChange(dataSpaceInfo: DataSpaceInfo) {
|
269
|
+
this.dataSpace = guaranteeType(
|
270
|
+
this.graphManagerState.graph.getElement(dataSpaceInfo.path),
|
271
|
+
DataSpace,
|
272
|
+
);
|
273
|
+
this.setExecutionContext(this.dataSpace.defaultExecutionContext);
|
274
|
+
this.propagateExecutionContextChange(
|
275
|
+
this.dataSpace.defaultExecutionContext,
|
276
|
+
);
|
277
|
+
}
|
278
|
+
|
279
|
+
updateElementOnDataSpaceChange() {
|
280
|
+
const dataSpaceExecutionContext =
|
281
|
+
new DataSpaceDataQualityExecutionContext();
|
282
|
+
dataSpaceExecutionContext.context = this.executionContext.name;
|
283
|
+
dataSpaceExecutionContext.dataSpace =
|
284
|
+
PackageableElementExplicitReference.create(this.dataSpace!);
|
285
|
+
dataQualityClassValidation_setDataQualityContext(
|
286
|
+
this.constraintsConfigurationElement,
|
287
|
+
dataSpaceExecutionContext,
|
288
|
+
);
|
289
|
+
this.updateElementOnClassChange();
|
290
|
+
}
|
291
|
+
|
292
|
+
*loadDataSpaces(): GeneratorFn<void> {
|
293
|
+
this.dataSpaces = this.graphManagerState.graph.allOwnElements
|
294
|
+
.filter(filterByType(DataSpace))
|
295
|
+
.map(
|
296
|
+
(e) =>
|
297
|
+
({
|
298
|
+
groupId: undefined,
|
299
|
+
artifactId: undefined,
|
300
|
+
versionId: undefined,
|
301
|
+
path: e.path,
|
302
|
+
name: e.name,
|
303
|
+
title: e.title,
|
304
|
+
defaultExecutionContext: e.defaultExecutionContext.name,
|
305
|
+
}) as DataSpaceInfo,
|
306
|
+
);
|
307
|
+
}
|
308
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { type Hashable, hashArray } from '@finos/legend-shared';
|
18
|
+
import {
|
19
|
+
type DataQualityGraphFetchTreeData,
|
20
|
+
type DataQualityGraphFetchTreeNodeData,
|
21
|
+
updateNodeConstraints,
|
22
|
+
addQueryBuilderPropertyNode,
|
23
|
+
buildGraphFetchTreeData,
|
24
|
+
} from '../utils/DataQualityGraphFetchTreeUtil.js';
|
25
|
+
import type { DataQualityState } from './DataQualityState.js';
|
26
|
+
import { action, makeObservable, observable } from 'mobx';
|
27
|
+
import {
|
28
|
+
type Class,
|
29
|
+
type Constraint,
|
30
|
+
PackageableElementExplicitReference,
|
31
|
+
} from '@finos/legend-graph';
|
32
|
+
import type {
|
33
|
+
QueryBuilderExplorerTreePropertyNodeData,
|
34
|
+
QueryBuilderExplorerTreeRootNodeData,
|
35
|
+
} from '@finos/legend-query-builder';
|
36
|
+
import { DataQualityRootGraphFetchTree } from '../../graph/metamodel/pure/packageableElements/data-quality/DataQualityGraphFetchTree.js';
|
37
|
+
import { DATA_QUALITY_HASH_STRUCTURE } from '../../graph/metamodel/DSL_DataQuality_HashUtils.js';
|
38
|
+
|
39
|
+
export class DataQualityGraphFetchTreeState implements Hashable {
|
40
|
+
readonly dataQualityState: DataQualityState;
|
41
|
+
treeData?: DataQualityGraphFetchTreeData | undefined;
|
42
|
+
|
43
|
+
constructor(dataQualityState: DataQualityState) {
|
44
|
+
makeObservable(this, {
|
45
|
+
treeData: observable.ref,
|
46
|
+
setGraphFetchTree: action,
|
47
|
+
});
|
48
|
+
|
49
|
+
this.dataQualityState = dataQualityState;
|
50
|
+
this.updateTreeData(
|
51
|
+
this.dataQualityState.dataQualityQueryBuilderState.class,
|
52
|
+
);
|
53
|
+
}
|
54
|
+
setGraphFetchTree(val: DataQualityGraphFetchTreeData | undefined): void {
|
55
|
+
this.treeData = val;
|
56
|
+
}
|
57
|
+
|
58
|
+
private updateTreeData(_class: Class | undefined): void {
|
59
|
+
this.setGraphFetchTree(
|
60
|
+
_class
|
61
|
+
? buildGraphFetchTreeData(
|
62
|
+
this.dataQualityState.editorStore,
|
63
|
+
new DataQualityRootGraphFetchTree(
|
64
|
+
PackageableElementExplicitReference.create(_class),
|
65
|
+
),
|
66
|
+
false,
|
67
|
+
false,
|
68
|
+
false,
|
69
|
+
)
|
70
|
+
: undefined,
|
71
|
+
);
|
72
|
+
}
|
73
|
+
|
74
|
+
onClassChange(_class: Class | undefined): void {
|
75
|
+
this.updateTreeData(_class);
|
76
|
+
}
|
77
|
+
|
78
|
+
updateNode(
|
79
|
+
node: DataQualityGraphFetchTreeNodeData,
|
80
|
+
constraint: Constraint,
|
81
|
+
addConstraint: boolean,
|
82
|
+
): void {
|
83
|
+
if (!this.treeData) {
|
84
|
+
this.dataQualityState.applicationStore.notificationService.notifyWarning(
|
85
|
+
`Can't add property: data quality graph-fetch tree has not been properly initialized`,
|
86
|
+
);
|
87
|
+
return;
|
88
|
+
}
|
89
|
+
updateNodeConstraints(this.treeData, node, constraint, addConstraint);
|
90
|
+
this.setGraphFetchTree({ ...this.treeData });
|
91
|
+
}
|
92
|
+
|
93
|
+
addProperty(
|
94
|
+
node:
|
95
|
+
| QueryBuilderExplorerTreePropertyNodeData
|
96
|
+
| QueryBuilderExplorerTreeRootNodeData,
|
97
|
+
options?: {
|
98
|
+
refreshTreeData?: boolean;
|
99
|
+
},
|
100
|
+
): void {
|
101
|
+
if (!this.treeData) {
|
102
|
+
this.dataQualityState.applicationStore.notificationService.notifyWarning(
|
103
|
+
`Can't add property: data quality graph-fetch tree has not been properly initialized`,
|
104
|
+
);
|
105
|
+
return;
|
106
|
+
}
|
107
|
+
addQueryBuilderPropertyNode(
|
108
|
+
this.treeData,
|
109
|
+
this.dataQualityState.dataQualityQueryBuilderState.explorerState
|
110
|
+
.nonNullableTreeData,
|
111
|
+
node,
|
112
|
+
this.dataQualityState,
|
113
|
+
);
|
114
|
+
if (options?.refreshTreeData) {
|
115
|
+
this.setGraphFetchTree({ ...this.treeData });
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
get hashCode(): string {
|
120
|
+
return hashArray([
|
121
|
+
DATA_QUALITY_HASH_STRUCTURE.DATA_QUALITY_GRAPH_FETCH_STATE,
|
122
|
+
this.treeData?.tree ?? '',
|
123
|
+
]);
|
124
|
+
}
|
125
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import { QueryBuilderState } from '@finos/legend-query-builder';
|
18
|
+
|
19
|
+
export class DataQualityQueryBuilderState extends QueryBuilderState {}
|
@@ -0,0 +1,217 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
3
|
+
*
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
* you may not use this file except in compliance with the License.
|
6
|
+
* You may obtain a copy of the License at
|
7
|
+
*
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
*
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
* See the License for the specific language governing permissions and
|
14
|
+
* limitations under the License.
|
15
|
+
*/
|
16
|
+
|
17
|
+
import type { DataQualityState } from './DataQualityState.js';
|
18
|
+
import {
|
19
|
+
ExecutionPlanState,
|
20
|
+
QUERY_BUILDER_EVENT,
|
21
|
+
QueryBuilderTelemetryHelper,
|
22
|
+
} from '@finos/legend-query-builder';
|
23
|
+
import { action, flow, makeObservable, observable } from 'mobx';
|
24
|
+
import {
|
25
|
+
type GeneratorFn,
|
26
|
+
ActionState,
|
27
|
+
assertErrorThrown,
|
28
|
+
LogEvent,
|
29
|
+
StopWatch,
|
30
|
+
} from '@finos/legend-shared';
|
31
|
+
import {
|
32
|
+
type RawExecutionPlan,
|
33
|
+
type ExecutionResult,
|
34
|
+
GRAPH_MANAGER_EVENT,
|
35
|
+
} from '@finos/legend-graph';
|
36
|
+
import { getDataQualityPureGraphManagerExtension } from '../../graph-manager/protocol/pure/DSL_DataQuality_PureGraphManagerExtension.js';
|
37
|
+
|
38
|
+
export const DEFAULT_LIMIT = 1000;
|
39
|
+
export class DataQualityResultState {
|
40
|
+
readonly dataQualityState: DataQualityState;
|
41
|
+
readonly executionPlanState: ExecutionPlanState;
|
42
|
+
|
43
|
+
previewLimit = DEFAULT_LIMIT;
|
44
|
+
pressedRunQuery = ActionState.create();
|
45
|
+
isRunningQuery = false;
|
46
|
+
isGeneratingPlan = false;
|
47
|
+
executionResult?: ExecutionResult | undefined;
|
48
|
+
executionDuration?: number | undefined;
|
49
|
+
latestRunHashCode?: string | undefined;
|
50
|
+
queryRunPromise: Promise<ExecutionResult> | undefined = undefined;
|
51
|
+
isQueryUsageViewerOpened = false;
|
52
|
+
|
53
|
+
constructor(dataQualityState: DataQualityState) {
|
54
|
+
makeObservable(this, {
|
55
|
+
executionResult: observable,
|
56
|
+
previewLimit: observable,
|
57
|
+
executionDuration: observable,
|
58
|
+
latestRunHashCode: observable,
|
59
|
+
queryRunPromise: observable,
|
60
|
+
isGeneratingPlan: observable,
|
61
|
+
isRunningQuery: observable,
|
62
|
+
setIsRunningQuery: action,
|
63
|
+
setExecutionResult: action,
|
64
|
+
setExecutionDuration: action,
|
65
|
+
setPreviewLimit: action,
|
66
|
+
setQueryRunPromise: action,
|
67
|
+
runQuery: flow,
|
68
|
+
cancelQuery: flow,
|
69
|
+
generatePlan: flow,
|
70
|
+
});
|
71
|
+
|
72
|
+
this.dataQualityState = dataQualityState;
|
73
|
+
this.executionPlanState = new ExecutionPlanState(
|
74
|
+
this.dataQualityState.applicationStore,
|
75
|
+
this.dataQualityState.graphManagerState,
|
76
|
+
);
|
77
|
+
}
|
78
|
+
|
79
|
+
setIsRunningQuery(val: boolean): void {
|
80
|
+
this.isRunningQuery = val;
|
81
|
+
}
|
82
|
+
|
83
|
+
setExecutionResult(val: ExecutionResult | undefined): void {
|
84
|
+
this.executionResult = val;
|
85
|
+
}
|
86
|
+
|
87
|
+
setExecutionDuration(val: number | undefined): void {
|
88
|
+
this.executionDuration = val;
|
89
|
+
}
|
90
|
+
|
91
|
+
setPreviewLimit(val: number): void {
|
92
|
+
this.previewLimit = Math.max(1, val);
|
93
|
+
}
|
94
|
+
|
95
|
+
setQueryRunPromise(promise: Promise<ExecutionResult> | undefined): void {
|
96
|
+
this.queryRunPromise = promise;
|
97
|
+
}
|
98
|
+
|
99
|
+
get checkForStaleResults(): boolean {
|
100
|
+
if (this.latestRunHashCode !== this.dataQualityState.hashCode) {
|
101
|
+
return true;
|
102
|
+
}
|
103
|
+
return false;
|
104
|
+
}
|
105
|
+
|
106
|
+
*runQuery(): GeneratorFn<void> {
|
107
|
+
let promise;
|
108
|
+
try {
|
109
|
+
this.setIsRunningQuery(true);
|
110
|
+
const currentHashCode = this.dataQualityState.hashCode;
|
111
|
+
const packagePath =
|
112
|
+
this.dataQualityState.constraintsConfigurationElement.path;
|
113
|
+
const model = this.dataQualityState.graphManagerState.graph;
|
114
|
+
|
115
|
+
const stopWatch = new StopWatch();
|
116
|
+
|
117
|
+
promise = getDataQualityPureGraphManagerExtension(
|
118
|
+
this.dataQualityState.graphManagerState.graphManager,
|
119
|
+
).execute(model, packagePath, this.previewLimit);
|
120
|
+
|
121
|
+
this.setQueryRunPromise(promise);
|
122
|
+
const result = (yield promise) as ExecutionResult;
|
123
|
+
|
124
|
+
if (this.queryRunPromise === promise) {
|
125
|
+
this.setExecutionResult(result);
|
126
|
+
this.latestRunHashCode = currentHashCode;
|
127
|
+
this.setExecutionDuration(stopWatch.elapsed);
|
128
|
+
}
|
129
|
+
} catch (error) {
|
130
|
+
if (this.queryRunPromise === promise) {
|
131
|
+
assertErrorThrown(error);
|
132
|
+
this.dataQualityState.applicationStore.logService.error(
|
133
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.EXECUTION_FAILURE),
|
134
|
+
error,
|
135
|
+
);
|
136
|
+
this.dataQualityState.applicationStore.notificationService.notifyError(
|
137
|
+
error,
|
138
|
+
);
|
139
|
+
}
|
140
|
+
} finally {
|
141
|
+
this.setIsRunningQuery(false);
|
142
|
+
this.pressedRunQuery.complete();
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
*cancelQuery(): GeneratorFn<void> {
|
147
|
+
this.pressedRunQuery.complete();
|
148
|
+
this.setIsRunningQuery(false);
|
149
|
+
this.setQueryRunPromise(undefined);
|
150
|
+
try {
|
151
|
+
yield this.dataQualityState.graphManagerState.graphManager.cancelUserExecutions(
|
152
|
+
true,
|
153
|
+
);
|
154
|
+
} catch (error) {
|
155
|
+
// Don't notify users about success or failure
|
156
|
+
this.dataQualityState.applicationStore.logService.error(
|
157
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.EXECUTION_FAILURE),
|
158
|
+
error,
|
159
|
+
);
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
*generatePlan(debug: boolean): GeneratorFn<void> {
|
164
|
+
const packagePath =
|
165
|
+
this.dataQualityState.constraintsConfigurationElement.path;
|
166
|
+
const model = this.dataQualityState.graphManagerState.graph;
|
167
|
+
try {
|
168
|
+
this.isGeneratingPlan = true;
|
169
|
+
let rawPlan: RawExecutionPlan;
|
170
|
+
|
171
|
+
const stopWatch = new StopWatch();
|
172
|
+
|
173
|
+
if (debug) {
|
174
|
+
const debugResult = (yield getDataQualityPureGraphManagerExtension(
|
175
|
+
this.dataQualityState.graphManagerState.graphManager,
|
176
|
+
).debugExecutionPlanGeneration(model, packagePath)) as {
|
177
|
+
plan: RawExecutionPlan;
|
178
|
+
debug: string;
|
179
|
+
};
|
180
|
+
rawPlan = debugResult.plan;
|
181
|
+
this.executionPlanState.setDebugText(debugResult.debug);
|
182
|
+
} else {
|
183
|
+
QueryBuilderTelemetryHelper.logEvent_ExecutionPlanGenerationLaunched(
|
184
|
+
this.dataQualityState.applicationStore.telemetryService,
|
185
|
+
);
|
186
|
+
rawPlan = (yield getDataQualityPureGraphManagerExtension(
|
187
|
+
this.dataQualityState.graphManagerState.graphManager,
|
188
|
+
).generatePlan(model, packagePath)) as RawExecutionPlan;
|
189
|
+
}
|
190
|
+
|
191
|
+
stopWatch.record();
|
192
|
+
try {
|
193
|
+
this.executionPlanState.setRawPlan(rawPlan);
|
194
|
+
const plan =
|
195
|
+
this.dataQualityState.graphManagerState.graphManager.buildExecutionPlan(
|
196
|
+
rawPlan,
|
197
|
+
this.dataQualityState.graphManagerState.graph,
|
198
|
+
);
|
199
|
+
this.executionPlanState.initialize(plan);
|
200
|
+
} catch {
|
201
|
+
//do nothing
|
202
|
+
}
|
203
|
+
stopWatch.record(QUERY_BUILDER_EVENT.BUILD_EXECUTION_PLAN__SUCCESS);
|
204
|
+
} catch (error) {
|
205
|
+
assertErrorThrown(error);
|
206
|
+
this.dataQualityState.applicationStore.logService.error(
|
207
|
+
LogEvent.create(GRAPH_MANAGER_EVENT.EXECUTION_FAILURE),
|
208
|
+
error,
|
209
|
+
);
|
210
|
+
this.dataQualityState.applicationStore.notificationService.notifyError(
|
211
|
+
error,
|
212
|
+
);
|
213
|
+
} finally {
|
214
|
+
this.isGeneratingPlan = false;
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|