mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-22 16:08:13 +00:00
Fixed: issue- 3226 and 3230 related to data config schema changes. (#3253)
This commit is contained in:
parent
434aa30a92
commit
b49f12b735
@ -191,16 +191,22 @@ const ColumnTestForm = ({
|
||||
const getTestConfi = () => {
|
||||
switch (columnTest) {
|
||||
case ColumnTestType.columnValueLengthsToBeBetween:
|
||||
return {
|
||||
minLength: !isEmpty(minValue) ? minValue : undefined,
|
||||
maxLength: !isEmpty(maxValue) ? maxValue : undefined,
|
||||
};
|
||||
case ColumnTestType.columnValuesToBeBetween:
|
||||
return {
|
||||
minValue: minValue,
|
||||
maxValue: maxValue,
|
||||
minValue: !isEmpty(minValue) ? minValue : undefined,
|
||||
maxValue: !isEmpty(maxValue) ? maxValue : undefined,
|
||||
};
|
||||
|
||||
case ColumnTestType.columnValuesMissingCountToBeEqual:
|
||||
return {
|
||||
missingCountValue: missingCountValue,
|
||||
missingValueMatch: missingValueMatch,
|
||||
missingValueMatch: !isEmpty(missingValueMatch)
|
||||
? missingValueMatch
|
||||
: undefined,
|
||||
};
|
||||
|
||||
case ColumnTestType.columnValuesToBeNotInSet:
|
||||
|
@ -115,20 +115,36 @@ const TableTestForm = ({
|
||||
return !Object.values(errMsg).includes(true);
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
const isTableRowCountToBeBetweenTest =
|
||||
tableTest === TableTestType.TableRowCountToBeBetween;
|
||||
const getConfigValue = () => {
|
||||
switch (tableTest) {
|
||||
case TableTestType.TableRowCountToBeBetween:
|
||||
return {
|
||||
maxValue: isEmpty(maxValue) ? undefined : maxValue,
|
||||
minValue: isEmpty(minValue) ? undefined : minValue,
|
||||
};
|
||||
|
||||
case TableTestType.TableColumnCountToEqual:
|
||||
return {
|
||||
columnCount: isEmpty(value) ? undefined : value,
|
||||
};
|
||||
|
||||
case TableTestType.TableRowCountToEqual:
|
||||
return {
|
||||
value: isEmpty(value) ? undefined : value,
|
||||
};
|
||||
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
const handleSave = () => {
|
||||
if (validateForm()) {
|
||||
const createTest: CreateTableTest = {
|
||||
description: markdownRef.current?.getEditorContent() || undefined,
|
||||
executionFrequency: frequency,
|
||||
testCase: {
|
||||
config: {
|
||||
maxValue: isTableRowCountToBeBetweenTest ? maxValue : undefined,
|
||||
minValue: isTableRowCountToBeBetweenTest ? minValue : undefined,
|
||||
value: isTableRowCountToBeBetweenTest ? undefined : value,
|
||||
},
|
||||
config: getConfigValue(),
|
||||
tableTestType: tableTest,
|
||||
},
|
||||
owner: {
|
||||
|
@ -136,8 +136,6 @@ export interface TableTestCase {
|
||||
export interface TableRowCountToBeBetween {
|
||||
/**
|
||||
* Expected number of rows {value}
|
||||
*
|
||||
* Expected number of columns to equal to a {value}
|
||||
*/
|
||||
value?: number;
|
||||
/**
|
||||
@ -150,6 +148,10 @@ export interface TableRowCountToBeBetween {
|
||||
* included, maxValue is treated as upperBound and there will be no minimum number of rows
|
||||
*/
|
||||
minValue?: number;
|
||||
/**
|
||||
* Expected number of columns to equal to a {value}
|
||||
*/
|
||||
columnCount?: number;
|
||||
}
|
||||
|
||||
export enum TableTestType {
|
||||
|
@ -0,0 +1,30 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This schema defines the test ColumnValueLengthsToBeBetween. Test the value lengths in a
|
||||
* column to be between minimum and maximum value.
|
||||
*/
|
||||
export interface ColumnValuesLengthsToBeBetween {
|
||||
/**
|
||||
* The {maxLength} for the column length. if maxLength is not included, minLength is treated
|
||||
* as lowerBound and there will eb no maximum number of rows
|
||||
*/
|
||||
maxLength?: number;
|
||||
/**
|
||||
* The {minLength} for the column length. If minLength is not included, maxLength is treated
|
||||
* as upperBound and there will be no minimum number of rows
|
||||
*/
|
||||
minLength?: number;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This schema defines the test ColumnValuesToBeBetween. Test the values in a column to be
|
||||
* between minimum and maximum value.
|
||||
*/
|
||||
export interface ColumnValuesToBeBetween {
|
||||
/**
|
||||
* The {maxValue} value for the column entry. if maxValue is not included, minValue is
|
||||
* treated as lowerBound and there will eb no maximum number of rows
|
||||
*/
|
||||
maxValue?: number;
|
||||
/**
|
||||
* The {minValue} value for the column entry. If minValue is not included, maxValue is
|
||||
* treated as upperBound and there will be no minimum number of rows
|
||||
*/
|
||||
minValue?: number;
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This schema defines the test ColumnValuesToBeNotInSet. Test the column values to not be
|
||||
* in the set.
|
||||
*/
|
||||
export interface ColumnValuesToBeNotInSet {
|
||||
/**
|
||||
* An Array of values.
|
||||
*/
|
||||
forbiddenValues: Array<number | string>;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This schema defines the test ColumnValuesToBeNotNull. Test the number of values in a
|
||||
* column are null. Values must be explicitly null. Empty strings don't count as null.
|
||||
*/
|
||||
export interface ColumnValuesToBeNotNull {}
|
@ -0,0 +1,20 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This schema defines the test ColumnValuesToBeUnique. Test the values in a column to be
|
||||
* unique.
|
||||
*/
|
||||
export interface ColumnValuesToBeUnique {}
|
@ -0,0 +1,24 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/*
|
||||
* Copyright 2021 Collate
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This schema defines the test ColumnValuesToMatchRegex. Test the values in a column to
|
||||
* match a given regular expression.
|
||||
*/
|
||||
export interface ColumnValuesToMatchRegex {
|
||||
/**
|
||||
* The regular expression the column entries should match.
|
||||
*/
|
||||
regex: string;
|
||||
}
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
export interface TableColumnCountToEqual {
|
||||
/**
|
||||
* Expected number of columns to equal to a {value}
|
||||
* Expected number of columns to equal to a {value}
|
||||
*/
|
||||
value: number;
|
||||
columnCount: number;
|
||||
}
|
||||
|
@ -147,8 +147,6 @@ export interface TableTestCase {
|
||||
export interface TableRowCountToBeBetween {
|
||||
/**
|
||||
* Expected number of rows {value}
|
||||
*
|
||||
* Expected number of columns to equal to a {value}
|
||||
*/
|
||||
value?: number;
|
||||
/**
|
||||
@ -161,6 +159,10 @@ export interface TableRowCountToBeBetween {
|
||||
* included, maxValue is treated as upperBound and there will be no minimum number of rows
|
||||
*/
|
||||
minValue?: number;
|
||||
/**
|
||||
* Expected number of columns to equal to a {value}
|
||||
*/
|
||||
columnCount?: number;
|
||||
}
|
||||
|
||||
export enum TableTestType {
|
||||
|
Loading…
x
Reference in New Issue
Block a user