From 3524df3389fbeda4c29a47e24a18a19dc5641e3d Mon Sep 17 00:00:00 2001 From: Teddy Date: Mon, 24 Apr 2023 18:42:40 +0200 Subject: [PATCH] Use display name in dq (#11200) --- .../connectors/ingestion/workflows/data-quality/tests.md | 6 ++++++ .../src/main/resources/ui/cypress/constants/constants.js | 5 ++++- .../ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js | 6 +++--- .../AddDataQualityTest/components/TestCaseForm.tsx | 3 ++- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/openmetadata-docs-v1/content/v1.0.0/connectors/ingestion/workflows/data-quality/tests.md b/openmetadata-docs-v1/content/v1.0.0/connectors/ingestion/workflows/data-quality/tests.md index b8b17fbadf3..c9f51f4f1b5 100644 --- a/openmetadata-docs-v1/content/v1.0.0/connectors/ingestion/workflows/data-quality/tests.md +++ b/openmetadata-docs-v1/content/v1.0.0/connectors/ingestion/workflows/data-quality/tests.md @@ -330,6 +330,12 @@ parameterValues: ### Table Row Inserted Count To Be Between Validate the number of rows inserted for the defined period is between the expected range +{% note %} + +The Table Row Inserted Count To Be Between cannot be executed against tables that have configured a partition in OpenMetadata. The logic of the test performed will be similar to executiong a Table Row Count to be Between test against a table with a partition configured. + +{% /note %} + **Properties** * `Min Row Count`: Lower bound diff --git a/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js b/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js index b16ed68d043..6df167c9b31 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js @@ -47,7 +47,7 @@ export const DATA_QUALITY_SAMPLE_DATA_TABLE = { serviceName: 'sample_data', testCaseName: 'column_value_max_to_be_between', testSuiteName: 'critical_metrics_suite', - sqlTestCase: 'tableCustomSQLQuery', + sqlTestCase: 'Custom SQL Query', sqlQuery: 'Select * from dim_address', }; @@ -170,6 +170,7 @@ export const NEW_TEST_SUITE = { }; export const NEW_TABLE_TEST_CASE = { + label: 'Table Column Name To Exist', type: 'tableColumnNameToExist', field: 'id', description: 'New table test case for TableColumnNameToExist', @@ -178,6 +179,7 @@ export const NEW_TABLE_TEST_CASE = { export const NEW_COLUMN_TEST_CASE = { column: 'id', type: 'columnValueLengthsToBeBetween', + label: 'Column Value Lengths To Be Between', min: 3, max: 6, description: 'New table test case for columnValueLengthsToBeBetween', @@ -186,6 +188,7 @@ export const NEW_COLUMN_TEST_CASE = { export const NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE = { column: 'id', type: 'columnValuesToBeNotNull', + label: 'Column Values To Be Not Null', description: 'New table test case for columnValuesToBeNotNull', }; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js index 74f52852932..649b5da5d0b 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js @@ -182,7 +182,7 @@ describe('Data Quality and Profiler should work properly', () => { // creating new test case cy.get('#tableTestForm_testTypeId').scrollIntoView().click(); - cy.contains(NEW_TABLE_TEST_CASE.type).should('be.visible').click(); + cy.contains(NEW_TABLE_TEST_CASE.label).should('be.visible').click(); cy.get('#tableTestForm_params_columnName') .should('be.visible') .type(NEW_TABLE_TEST_CASE.field); @@ -304,7 +304,7 @@ describe('Data Quality and Profiler should work properly', () => { // creating new test case cy.get('#tableTestForm_testTypeId').scrollIntoView().click(); - cy.get(`[title="${NEW_COLUMN_TEST_CASE.type}"]`) + cy.get(`[title="${NEW_COLUMN_TEST_CASE.label}"]`) .scrollIntoView() .should('be.visible') .click(); @@ -359,7 +359,7 @@ describe('Data Quality and Profiler should work properly', () => { .click(); cy.get('#tableTestForm_testTypeId').scrollIntoView().click(); - cy.get(`[title="${NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE.type}"]`) + cy.get(`[title="${NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE.label}"]`) .scrollIntoView() .should('be.visible') .click(); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx index 083ca15801f..ea0f6cabdca 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/components/TestCaseForm.tsx @@ -19,6 +19,7 @@ import { isEmpty } from 'lodash'; import React, { useCallback, useEffect, useRef, useState } from 'react'; import { useParams } from 'react-router-dom'; import { getListTestCase, getListTestDefinitions } from 'rest/testAPI'; +import { getEntityName } from 'utils/EntityUtils'; import { API_RES_MAX_SIZE } from '../../../constants/constants'; import { CSMode } from '../../../enums/codemirror.enum'; import { ProfilerDashboardType } from '../../../enums/table.enum'; @@ -284,7 +285,7 @@ const TestCaseForm: React.FC = ({ ]}>