mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 12:08:31 +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,
|
||||
colName: col.name,
|
||||
colType: col.dataTypeDisplay as string,
|
||||
dataType: col.dataType as string,
|
||||
colTests: col.columnTests,
|
||||
}))}
|
||||
qualityTestFormHandler={qualityTestFormHandler}
|
||||
|
||||
@ -24,6 +24,7 @@ import {
|
||||
ColumnTest,
|
||||
DatasetTestModeType,
|
||||
} from '../../interface/dataQuality.interface';
|
||||
import { isColumnTestSupported } from '../../utils/EntityUtils';
|
||||
import { getRoundedValue } from '../../utils/ProfilerUtils';
|
||||
import { getConstraintIcon } from '../../utils/TableUtils';
|
||||
import { Button } from '../buttons/Button/Button';
|
||||
@ -37,6 +38,7 @@ type Props = {
|
||||
constraint: string;
|
||||
colName: string;
|
||||
colType: string;
|
||||
dataType: string;
|
||||
colTests?: ColumnTest[];
|
||||
}>;
|
||||
qualityTestFormHandler: (
|
||||
@ -246,7 +248,7 @@ const TableProfiler: FC<Props> = ({
|
||||
colSpan={2}
|
||||
data-testid="tableBody-cell">
|
||||
<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">
|
||||
{col.columnTests.map((m, i) => (
|
||||
<div className="tw-flex tw-mb-2" key={i}>
|
||||
@ -290,7 +292,7 @@ const TableProfiler: FC<Props> = ({
|
||||
`No tests available`
|
||||
)}
|
||||
<div className="tw-self-center tw-ml-5">
|
||||
{col.name.colType.includes('struct') ? (
|
||||
{!isColumnTestSupported(col.name.dataType) ? (
|
||||
<span>Not supported</span>
|
||||
) : (
|
||||
<NonAdminAction
|
||||
|
||||
@ -17,3 +17,11 @@ export enum ConstraintTypes {
|
||||
NOT_NULL = 'NOT_NULL',
|
||||
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 { EntityType } from '../enums/entity.enum';
|
||||
import { ServiceCategory } from '../enums/service.enum';
|
||||
import { PrimaryTableDataTypes } from '../enums/table.enum';
|
||||
import { Dashboard } from '../generated/entity/data/dashboard';
|
||||
import { Pipeline } from '../generated/entity/data/pipeline';
|
||||
import { Table } from '../generated/entity/data/table';
|
||||
@ -525,3 +526,11 @@ export const filteredColumnTestOption = (dataType: string) => {
|
||||
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';
|
||||
import { EntityType } from '../enums/entity.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 { TableTest, TestCaseStatus } from '../generated/tests/tableTest';
|
||||
import { TagLabel } from '../generated/type/tagLabel';
|
||||
@ -291,22 +291,22 @@ export const getDataTypeString = (dataType: string): string => {
|
||||
case DataType.Mediumtext:
|
||||
case DataType.Mediumblob:
|
||||
case DataType.Blob:
|
||||
return 'varchar';
|
||||
return PrimaryTableDataTypes.VARCHAR;
|
||||
case DataType.Timestamp:
|
||||
case DataType.Time:
|
||||
return 'timestamp';
|
||||
return PrimaryTableDataTypes.TIMESTAMP;
|
||||
case DataType.Date:
|
||||
return 'date';
|
||||
return PrimaryTableDataTypes.DATE;
|
||||
case DataType.Int:
|
||||
case DataType.Float:
|
||||
case DataType.Smallint:
|
||||
case DataType.Bigint:
|
||||
case DataType.Numeric:
|
||||
case DataType.Tinyint:
|
||||
return 'numeric';
|
||||
return PrimaryTableDataTypes.NUMERIC;
|
||||
case DataType.Boolean:
|
||||
case DataType.Enum:
|
||||
return 'boolean';
|
||||
return PrimaryTableDataTypes.BOOLEAN;
|
||||
default:
|
||||
return dataType;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user