mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-10 07:53:35 +00:00
fix: issue-3425 Profiler: add test based on included datatype, issue-3407 Deleting column test shows blank in data-profiler for that column (#3429)
* fix: issue-3425 updated condition as per supported datatype
This commit is contained in:
parent
55c65b5c53
commit
0ab6b29738
@ -633,6 +633,7 @@ const DatasetDetails: React.FC<DatasetDetailsProps> = ({
|
|||||||
constraint: col.constraint as string,
|
constraint: col.constraint as string,
|
||||||
colName: col.name,
|
colName: col.name,
|
||||||
colType: col.dataTypeDisplay as string,
|
colType: col.dataTypeDisplay as string,
|
||||||
|
dataType: col.dataType as string,
|
||||||
colTests: col.columnTests,
|
colTests: col.columnTests,
|
||||||
}))}
|
}))}
|
||||||
qualityTestFormHandler={qualityTestFormHandler}
|
qualityTestFormHandler={qualityTestFormHandler}
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import {
|
|||||||
ColumnTest,
|
ColumnTest,
|
||||||
DatasetTestModeType,
|
DatasetTestModeType,
|
||||||
} from '../../interface/dataQuality.interface';
|
} from '../../interface/dataQuality.interface';
|
||||||
|
import { isColumnTestSupported } from '../../utils/EntityUtils';
|
||||||
import { getRoundedValue } from '../../utils/ProfilerUtils';
|
import { getRoundedValue } from '../../utils/ProfilerUtils';
|
||||||
import { getConstraintIcon } from '../../utils/TableUtils';
|
import { getConstraintIcon } from '../../utils/TableUtils';
|
||||||
import { Button } from '../buttons/Button/Button';
|
import { Button } from '../buttons/Button/Button';
|
||||||
@ -37,6 +38,7 @@ type Props = {
|
|||||||
constraint: string;
|
constraint: string;
|
||||||
colName: string;
|
colName: string;
|
||||||
colType: string;
|
colType: string;
|
||||||
|
dataType: string;
|
||||||
colTests?: ColumnTest[];
|
colTests?: ColumnTest[];
|
||||||
}>;
|
}>;
|
||||||
qualityTestFormHandler: (
|
qualityTestFormHandler: (
|
||||||
@ -246,7 +248,7 @@ const TableProfiler: FC<Props> = ({
|
|||||||
colSpan={2}
|
colSpan={2}
|
||||||
data-testid="tableBody-cell">
|
data-testid="tableBody-cell">
|
||||||
<div className="tw-flex tw-justify-between">
|
<div className="tw-flex tw-justify-between">
|
||||||
{col.columnTests ? (
|
{col.columnTests?.length ? (
|
||||||
<div className="tw-rounded tw-max-h-44 tw-overflow-y-auto tw-flex-1">
|
<div className="tw-rounded tw-max-h-44 tw-overflow-y-auto tw-flex-1">
|
||||||
{col.columnTests.map((m, i) => (
|
{col.columnTests.map((m, i) => (
|
||||||
<div className="tw-flex tw-mb-2" key={i}>
|
<div className="tw-flex tw-mb-2" key={i}>
|
||||||
@ -290,7 +292,7 @@ const TableProfiler: FC<Props> = ({
|
|||||||
`No tests available`
|
`No tests available`
|
||||||
)}
|
)}
|
||||||
<div className="tw-self-center tw-ml-5">
|
<div className="tw-self-center tw-ml-5">
|
||||||
{col.name.colType.includes('struct') ? (
|
{!isColumnTestSupported(col.name.dataType) ? (
|
||||||
<span>Not supported</span>
|
<span>Not supported</span>
|
||||||
) : (
|
) : (
|
||||||
<NonAdminAction
|
<NonAdminAction
|
||||||
|
|||||||
@ -17,3 +17,11 @@ export enum ConstraintTypes {
|
|||||||
NOT_NULL = 'NOT_NULL',
|
NOT_NULL = 'NOT_NULL',
|
||||||
UNIQUE = 'UNIQUE',
|
UNIQUE = 'UNIQUE',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum PrimaryTableDataTypes {
|
||||||
|
VARCHAR = 'varchar',
|
||||||
|
TIMESTAMP = 'timestamp',
|
||||||
|
DATE = 'date',
|
||||||
|
NUMERIC = 'numeric',
|
||||||
|
BOOLEAN = 'boolean',
|
||||||
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import {
|
|||||||
import { ColumnTestType } from '../enums/columnTest.enum';
|
import { ColumnTestType } from '../enums/columnTest.enum';
|
||||||
import { EntityType } from '../enums/entity.enum';
|
import { EntityType } from '../enums/entity.enum';
|
||||||
import { ServiceCategory } from '../enums/service.enum';
|
import { ServiceCategory } from '../enums/service.enum';
|
||||||
|
import { PrimaryTableDataTypes } from '../enums/table.enum';
|
||||||
import { Dashboard } from '../generated/entity/data/dashboard';
|
import { Dashboard } from '../generated/entity/data/dashboard';
|
||||||
import { Pipeline } from '../generated/entity/data/pipeline';
|
import { Pipeline } from '../generated/entity/data/pipeline';
|
||||||
import { Table } from '../generated/entity/data/table';
|
import { Table } from '../generated/entity/data/table';
|
||||||
@ -525,3 +526,11 @@ export const filteredColumnTestOption = (dataType: string) => {
|
|||||||
return Object.values(ColumnTestType);
|
return Object.values(ColumnTestType);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isColumnTestSupported = (dataType: string) => {
|
||||||
|
const supportedType = Object.values(PrimaryTableDataTypes);
|
||||||
|
|
||||||
|
return supportedType.includes(
|
||||||
|
getDataTypeString(dataType) as PrimaryTableDataTypes
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import {
|
|||||||
} from '../constants/constants';
|
} from '../constants/constants';
|
||||||
import { EntityType } from '../enums/entity.enum';
|
import { EntityType } from '../enums/entity.enum';
|
||||||
import { SearchIndex } from '../enums/search.enum';
|
import { SearchIndex } from '../enums/search.enum';
|
||||||
import { ConstraintTypes } from '../enums/table.enum';
|
import { ConstraintTypes, PrimaryTableDataTypes } from '../enums/table.enum';
|
||||||
import { Column, DataType } from '../generated/entity/data/table';
|
import { Column, DataType } from '../generated/entity/data/table';
|
||||||
import { TableTest, TestCaseStatus } from '../generated/tests/tableTest';
|
import { TableTest, TestCaseStatus } from '../generated/tests/tableTest';
|
||||||
import { TagLabel } from '../generated/type/tagLabel';
|
import { TagLabel } from '../generated/type/tagLabel';
|
||||||
@ -291,22 +291,22 @@ export const getDataTypeString = (dataType: string): string => {
|
|||||||
case DataType.Mediumtext:
|
case DataType.Mediumtext:
|
||||||
case DataType.Mediumblob:
|
case DataType.Mediumblob:
|
||||||
case DataType.Blob:
|
case DataType.Blob:
|
||||||
return 'varchar';
|
return PrimaryTableDataTypes.VARCHAR;
|
||||||
case DataType.Timestamp:
|
case DataType.Timestamp:
|
||||||
case DataType.Time:
|
case DataType.Time:
|
||||||
return 'timestamp';
|
return PrimaryTableDataTypes.TIMESTAMP;
|
||||||
case DataType.Date:
|
case DataType.Date:
|
||||||
return 'date';
|
return PrimaryTableDataTypes.DATE;
|
||||||
case DataType.Int:
|
case DataType.Int:
|
||||||
case DataType.Float:
|
case DataType.Float:
|
||||||
case DataType.Smallint:
|
case DataType.Smallint:
|
||||||
case DataType.Bigint:
|
case DataType.Bigint:
|
||||||
case DataType.Numeric:
|
case DataType.Numeric:
|
||||||
case DataType.Tinyint:
|
case DataType.Tinyint:
|
||||||
return 'numeric';
|
return PrimaryTableDataTypes.NUMERIC;
|
||||||
case DataType.Boolean:
|
case DataType.Boolean:
|
||||||
case DataType.Enum:
|
case DataType.Enum:
|
||||||
return 'boolean';
|
return PrimaryTableDataTypes.BOOLEAN;
|
||||||
default:
|
default:
|
||||||
return dataType;
|
return dataType;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user