mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 20:51:26 +00:00
This commit is contained in:
parent
2f3a50e95f
commit
ae71a11a8c
@ -36,7 +36,6 @@ import { getEntityBreadcrumbs, getEntityName } from 'utils/EntityUtils';
|
||||
import { getEncodedFqn } from 'utils/StringsUtils';
|
||||
import { getTableTabPath } from '../../constants/constants';
|
||||
import {
|
||||
allowedServiceForOperationGraph,
|
||||
DEFAULT_RANGE_DATA,
|
||||
STEPS_FOR_ADD_TEST_CASE,
|
||||
} from '../../constants/profiler.constant';
|
||||
@ -232,10 +231,6 @@ const AddDataQualityTestV1: React.FC<AddDataQualityTestProps> = ({
|
||||
<TableProfilerChart
|
||||
dateRangeObject={DEFAULT_RANGE_DATA}
|
||||
entityFqn={entityTypeFQN}
|
||||
showOperationGraph={
|
||||
table.serviceType &&
|
||||
allowedServiceForOperationGraph.includes(table.serviceType)
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{isColumnFqn && (
|
||||
|
@ -47,12 +47,7 @@ describe('TableProfilerChart component test', () => {
|
||||
const mockGetSystemProfileList = getSystemProfileList as jest.Mock;
|
||||
const mockGetTableProfilesList = getTableProfilesList as jest.Mock;
|
||||
act(() => {
|
||||
render(
|
||||
<TableProfilerChart
|
||||
showOperationGraph
|
||||
dateRangeObject={mockDateRangeObject}
|
||||
/>
|
||||
);
|
||||
render(<TableProfilerChart dateRangeObject={mockDateRangeObject} />);
|
||||
});
|
||||
|
||||
expect(
|
||||
@ -77,12 +72,7 @@ describe('TableProfilerChart component test', () => {
|
||||
const mockGetSystemProfileList = getSystemProfileList as jest.Mock;
|
||||
const mockGetTableProfilesList = getTableProfilesList as jest.Mock;
|
||||
await act(async () => {
|
||||
render(
|
||||
<TableProfilerChart
|
||||
showOperationGraph
|
||||
dateRangeObject={mockDateRangeObject}
|
||||
/>
|
||||
);
|
||||
render(<TableProfilerChart dateRangeObject={mockDateRangeObject} />);
|
||||
});
|
||||
|
||||
// API should be call once
|
||||
@ -111,12 +101,7 @@ describe('TableProfilerChart component test', () => {
|
||||
const mockGetTableProfilesList = getTableProfilesList as jest.Mock;
|
||||
|
||||
await act(async () => {
|
||||
render(
|
||||
<TableProfilerChart
|
||||
showOperationGraph
|
||||
dateRangeObject={mockDateRangeObject}
|
||||
/>
|
||||
);
|
||||
render(<TableProfilerChart dateRangeObject={mockDateRangeObject} />);
|
||||
});
|
||||
|
||||
// API should be call with proper Param value
|
||||
|
@ -38,7 +38,6 @@ import { TableProfilerChartProps } from '../TableProfiler.interface';
|
||||
const TableProfilerChart = ({
|
||||
dateRangeObject,
|
||||
entityFqn = '',
|
||||
showOperationGraph = false,
|
||||
}: TableProfilerChartProps) => {
|
||||
const { datasetFQN } = useParams<{ datasetFQN: string }>();
|
||||
const { t } = useTranslation();
|
||||
@ -116,59 +115,53 @@ const TableProfilerChart = ({
|
||||
title={t('label.data-volume')}
|
||||
/>
|
||||
</Col>
|
||||
{showOperationGraph && (
|
||||
<>
|
||||
<Col span={24}>
|
||||
<Card
|
||||
className="shadow-none global-border-radius"
|
||||
data-testid="operation-date-metrics">
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={24}>
|
||||
<Typography.Title level={5}>
|
||||
{t('label.table-update-plural')}
|
||||
</Typography.Title>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<ProfilerLatestValue
|
||||
stringValue
|
||||
information={operationDateMetrics.information}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={20}>
|
||||
<OperationDateBarChart
|
||||
chartCollection={operationDateMetrics}
|
||||
name="operationDateMetrics"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Card
|
||||
className="shadow-none global-border-radius"
|
||||
data-testid="operation-metrics">
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={24}>
|
||||
<Typography.Title level={5}>
|
||||
{t('label.volume-change')}
|
||||
</Typography.Title>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<ProfilerLatestValue
|
||||
information={operationMetrics.information}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={20}>
|
||||
<CustomBarChart
|
||||
chartCollection={operationMetrics}
|
||||
name="operationMetrics"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
</>
|
||||
)}
|
||||
<Col span={24}>
|
||||
<Card
|
||||
className="shadow-none global-border-radius"
|
||||
data-testid="operation-date-metrics">
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={24}>
|
||||
<Typography.Title level={5}>
|
||||
{t('label.table-update-plural')}
|
||||
</Typography.Title>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<ProfilerLatestValue
|
||||
stringValue
|
||||
information={operationDateMetrics.information}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={20}>
|
||||
<OperationDateBarChart
|
||||
chartCollection={operationDateMetrics}
|
||||
name="operationDateMetrics"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<Card
|
||||
className="shadow-none global-border-radius"
|
||||
data-testid="operation-metrics">
|
||||
<Row gutter={[16, 16]}>
|
||||
<Col span={24}>
|
||||
<Typography.Title level={5}>
|
||||
{t('label.volume-change')}
|
||||
</Typography.Title>
|
||||
</Col>
|
||||
<Col span={4}>
|
||||
<ProfilerLatestValue information={operationMetrics.information} />
|
||||
</Col>
|
||||
<Col span={20}>
|
||||
<CustomBarChart
|
||||
chartCollection={operationMetrics}
|
||||
name="operationMetrics"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
);
|
||||
};
|
||||
|
@ -86,7 +86,6 @@ export type TableProfilerData = {
|
||||
export type TableProfilerChartProps = {
|
||||
dateRangeObject: DateRangeObject;
|
||||
entityFqn?: string;
|
||||
showOperationGraph?: boolean;
|
||||
};
|
||||
|
||||
export interface ProfilerSettingModalState {
|
||||
|
@ -70,7 +70,6 @@ import { ReactComponent as TableProfileIcon } from '../../assets/svg/table-profi
|
||||
import { API_RES_MAX_SIZE } from '../../constants/constants';
|
||||
import { PAGE_HEADERS } from '../../constants/PageHeaders.constant';
|
||||
import {
|
||||
allowedServiceForOperationGraph,
|
||||
DEFAULT_RANGE_DATA,
|
||||
INITIAL_TEST_RESULT_SUMMARY,
|
||||
} from '../../constants/profiler.constant';
|
||||
@ -141,14 +140,6 @@ const TableProfilerV1: FC<TableProfilerProps> = ({
|
||||
const [dateRangeObject, setDateRangeObject] =
|
||||
useState<DateRangeObject>(DEFAULT_RANGE_DATA);
|
||||
|
||||
const showOperationGraph = useMemo(() => {
|
||||
if (table?.serviceType) {
|
||||
return allowedServiceForOperationGraph.includes(table.serviceType);
|
||||
}
|
||||
|
||||
return false;
|
||||
}, [table]);
|
||||
|
||||
const isColumnProfile = activeTab === TableProfilerTab.COLUMN_PROFILE;
|
||||
const isDataQuality = activeTab === TableProfilerTab.DATA_QUALITY;
|
||||
const isTableProfile = activeTab === TableProfilerTab.TABLE_PROFILE;
|
||||
@ -694,10 +685,7 @@ const TableProfilerV1: FC<TableProfilerProps> = ({
|
||||
)}
|
||||
|
||||
{isTableProfile && (
|
||||
<TableProfilerChart
|
||||
dateRangeObject={dateRangeObject}
|
||||
showOperationGraph={showOperationGraph}
|
||||
/>
|
||||
<TableProfilerChart dateRangeObject={dateRangeObject} />
|
||||
)}
|
||||
|
||||
{settingModalVisible && (
|
||||
|
@ -22,7 +22,6 @@ import { CSMode } from '../enums/codemirror.enum';
|
||||
import { DMLOperationType } from '../generated/api/data/createTableProfile';
|
||||
import {
|
||||
ColumnProfilerConfig,
|
||||
DatabaseServiceType,
|
||||
DataType,
|
||||
PartitionIntervalType,
|
||||
PartitionIntervalUnit,
|
||||
@ -395,9 +394,3 @@ export const TIME_BASED_PARTITION = [
|
||||
PartitionIntervalType.IngestionTime,
|
||||
PartitionIntervalType.TimeUnit,
|
||||
];
|
||||
|
||||
export const allowedServiceForOperationGraph = [
|
||||
DatabaseServiceType.BigQuery,
|
||||
DatabaseServiceType.Redshift,
|
||||
DatabaseServiceType.Snowflake,
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user