Address backend DQ feedback (#12150)

* fix: add jp and zh index

* fix: updated testCase tooltips

* fix: changed list testSuite permission to VEW_TEST + set owner of table for executable testSuite
This commit is contained in:
Teddy 2023-06-27 08:27:05 +02:00 committed by GitHub
parent 5871d515ef
commit 36dd1b6b2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 672 additions and 11 deletions

View File

@ -52,6 +52,8 @@ import org.openmetadata.service.resources.Collection;
import org.openmetadata.service.resources.EntityResource;
import org.openmetadata.service.security.Authorizer;
import org.openmetadata.service.security.policyevaluator.OperationContext;
import org.openmetadata.service.security.policyevaluator.ResourceContext;
import org.openmetadata.service.util.EntityUtil;
import org.openmetadata.service.util.FullyQualifiedName;
import org.openmetadata.service.util.RestUtil;
import org.openmetadata.service.util.ResultList;
@ -143,7 +145,14 @@ public class TestSuiteResource extends EntityResource<TestSuite, TestSuiteReposi
throws IOException {
ListFilter filter = new ListFilter(include);
filter.addQueryParam("testSuiteType", testSuiteType);
return super.listInternal(uriInfo, securityContext, fieldsParam, filter, limitParam, before, after);
EntityUtil.Fields fields = getFields(fieldsParam);
ResourceContext resourceContext;
resourceContext = getResourceContext(entityType, repository).build();
OperationContext operationContext = new OperationContext(Entity.TABLE, MetadataOperation.VIEW_TESTS);
return super.listInternal(
uriInfo, securityContext, fields, filter, limitParam, before, after, operationContext, resourceContext);
}
@GET
@ -298,6 +307,7 @@ public class TestSuiteResource extends EntityResource<TestSuite, TestSuiteReposi
Entity.getEntityByName(Entity.TABLE, create.getExecutableEntityReference(), null, null); // check if entity exists
TestSuite testSuite = getTestSuite(create, securityContext.getUserPrincipal().getName());
testSuite.setExecutable(true);
testSuite = setExecutableTestSuiteOwner(testSuite);
testSuite = setExecutableTestSuiteName(testSuite);
return create(uriInfo, securityContext, testSuite);
}
@ -550,6 +560,17 @@ public class TestSuiteResource extends EntityResource<TestSuite, TestSuiteReposi
return testSuite.withDisplayName(name).withName(hashedName);
}
private TestSuite setExecutableTestSuiteOwner(TestSuite testSuite) throws IOException {
Table tableEntity =
Entity.getEntity(
testSuite.getExecutableEntityReference().getType(),
testSuite.getExecutableEntityReference().getId(),
"owner",
ALL);
EntityReference ownerReference = tableEntity.getOwner();
return testSuite.withOwner(ownerReference);
}
@Override
public TestSuite getByNameInternal(
UriInfo uriInfo, SecurityContext securityContext, String name, String fieldsParam, Include include)

View File

@ -0,0 +1,325 @@
{
"settings": {
"analysis": {
"normalizer": {
"lowercase_normalizer": {
"type": "custom",
"char_filter": [],
"filter": [
"lowercase"
]
}
},
"analyzer": {
"om_analyzer": {
"tokenizer": "letter",
"filter": [
"lowercase",
"om_stemmer"
]
},
"om_analyzer_jp" : {
"tokenizer" : "kuromoji_tokenizer",
"type" : "custom",
"filter" : [
"kuromoji_baseform",
"kuromoji_part_of_speech",
"kuromoji_number",
"kuromoji_stemmer"
]
},
"om_ngram": {
"tokenizer": "ngram",
"min_gram": 1,
"max_gram": 2,
"filter": [
"lowercase"
]
}
},
"filter": {
"om_stemmer": {
"type": "stemmer",
"name": "english"
}
}
}
},
"mappings": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "text",
"analyzer": "om_analyzer_jp",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"fullyQualifiedName": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"displayName": {
"type": "text",
"analyzer": "om_analyzer_jp",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"description": {
"type": "text",
"analyzer": "om_analyzer_jp",
"fields": {
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"entityLink": {
"type": "text"
},
"entityFQN": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"parameterValues": {
"properties": {
"name": {
"type": "text",
"analyzer": "om_analyzer_jp",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"value": {
"type": "text"
}
}
},
"testDefinition": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "text",
"analyzer": "om_analyzer_jp",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"fullyQualifiedName": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"displayName": {
"type": "text",
"analyzer": "om_analyzer_jp",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"description": {
"type": "text",
"analyzer": "om_analyzer_jp",
"fields": {
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"entityType": {
"type": "keyword"
},
"testPlatforms": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"owner": {
"properties": {
"id": {
"type": "text"
},
"type": {
"type": "keyword"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"displayName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
}
}
},
"testSuite": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"displayName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
},
"executable": {
"type": "text"
}
}
},
"testSuites": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"displayName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
},
"executable": {
"type": "text"
}
}
},
"version": {
"type": "float"
},
"updatedAt": {
"type": "date",
"format": "epoch_second"
},
"updatedBy": {
"type": "text"
},
"href": {
"type": "text"
},
"deleted": {
"type": "text"
}
}
}
}

View File

@ -0,0 +1,315 @@
{
"settings": {
"analysis": {
"normalizer": {
"lowercase_normalizer": {
"type": "custom",
"char_filter": [],
"filter": [
"lowercase"
]
}
},
"analyzer": {
"om_analyzer": {
"tokenizer": "letter",
"filter": [
"lowercase",
"om_stemmer"
]
},
"om_ngram": {
"tokenizer": "ngram",
"min_gram": 1,
"max_gram": 2,
"filter": [
"lowercase"
]
}
},
"filter": {
"om_stemmer": {
"type": "stemmer",
"name": "english"
}
}
}
},
"mappings": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"fullyQualifiedName": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"displayName": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"description": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"entityLink": {
"type": "text"
},
"entityFQN": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"parameterValues": {
"properties": {
"name": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"value": {
"type": "text"
}
}
},
"testDefinition": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"fullyQualifiedName": {
"type": "keyword",
"normalizer": "lowercase_normalizer"
},
"displayName": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
},
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"description": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"ngram": {
"type": "text",
"analyzer": "om_ngram"
}
}
},
"entityType": {
"type": "keyword"
},
"testPlatforms": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"owner": {
"properties": {
"id": {
"type": "text"
},
"type": {
"type": "keyword"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"displayName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
}
}
},
"testSuite": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"displayName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
},
"executable": {
"type": "text"
}
}
},
"testSuites": {
"properties": {
"id": {
"type": "text"
},
"name": {
"type": "keyword",
"normalizer": "lowercase_normalizer",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"displayName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"fullyQualifiedName": {
"type": "text"
},
"description": {
"type": "text"
},
"deleted": {
"type": "text"
},
"href": {
"type": "text"
},
"executable": {
"type": "text"
}
}
},
"version": {
"type": "float"
},
"updatedAt": {
"type": "date",
"format": "epoch_second"
},
"updatedBy": {
"type": "text"
},
"href": {
"type": "text"
},
"deleted": {
"type": "text"
}
}
}
}

View File

@ -16,7 +16,7 @@
{
"name": "maxValueForMeanInCol",
"displayName": "Max",
"description": "Expected mean value for the column to be greater or equal than",
"description": "Expected mean value for the column to be lower or equal than",
"dataType": "INT"
}
]

View File

@ -16,7 +16,7 @@
{
"name": "maxValueForMedianInCol",
"displayName": "Max",
"description": "Expected median value for the column to be greater or equal than",
"description": "Expected median value for the column to be lower or equal than",
"dataType": "INT"
}
]

View File

@ -16,7 +16,7 @@
{
"name": "maxValueForStdDevInCol",
"displayName": "Max",
"description": "Expected std. dev value for the column to be greater or equal than",
"description": "Expected std. dev value for the column to be lower or equal than",
"dataType": "INT"
}
]

View File

@ -10,13 +10,13 @@
{
"name": "minLength",
"displayName": "Min",
"description": "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",
"description": "The {minLength} for the column value. If minLength is not included, maxLength is treated as upperBound and there will be no minimum value length",
"dataType": "INT"
},
{
"name": "maxLength",
"displayName": "Max",
"description": "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",
"description": "The {maxLength} for the column value. if maxLength is not included, minLength is treated as lowerBound and there will be no maximum value length",
"dataType": "INT"
}
]

View File

@ -10,13 +10,13 @@
{
"name": "minValue",
"displayName": "Min",
"description": "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",
"description": "The {minValue} value for the column entry. If minValue is not included, maxValue is treated as upperBound and there will be no minimum",
"dataType": "INT"
},
{
"name": "maxValue",
"displayName": "Max",
"description": "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",
"description": "The {maxValue} value for the column entry. if maxValue is not included, minValue is treated as lowerBound and there will be no maximum",
"dataType": "INT"
}
]

View File

@ -9,7 +9,7 @@
{
"name": "columnNames",
"displayName": "Column Names",
"description": "Expected columns names of the table to match the ones in {Column Names} -- should be a coma seperated string",
"description": "Expected columns names of the table to match the ones in {Column Names} -- should be a coma separated string",
"dataType": "STRING",
"required": "true"
},

View File

@ -9,13 +9,13 @@
{
"name": "minValue",
"displayName": "Min",
"description": "Expected number of columns should be greater than or equal to {minValue}. If minValue is not included, maxValue is treated as upperBound and there will be no minimum number of column",
"description": "Expected number of columns should be greater than or equal to {minValue}. If minValue is not included, maxValue is treated as upperBound and there will be no minimum",
"dataType": "INT"
},
{
"name": "maxValue",
"displayName": "Max",
"description": "Expected number of columns should be less than or equal to {maxValue}. If maxValue is not included, minValue is treated as lowerBound and there will be no maximum number of column",
"description": "Expected number of columns should be less than or equal to {maxValue}. If maxValue is not included, minValue is treated as lowerBound and there will be no maximum",
"dataType": "INT"
}
]