diff --git a/legend-engine-xts-dataquality/legend-engine-xt-dataquality-generation/src/main/java/org/finos/legend/engine/generation/dataquality/DataQualityLambdaGenerator.java b/legend-engine-xts-dataquality/legend-engine-xt-dataquality-generation/src/main/java/org/finos/legend/engine/generation/dataquality/DataQualityLambdaGenerator.java index 439bb439a8..4aeac43006 100644 --- a/legend-engine-xts-dataquality/legend-engine-xt-dataquality-generation/src/main/java/org/finos/legend/engine/generation/dataquality/DataQualityLambdaGenerator.java +++ b/legend-engine-xts-dataquality/legend-engine-xt-dataquality-generation/src/main/java/org/finos/legend/engine/generation/dataquality/DataQualityLambdaGenerator.java @@ -75,11 +75,7 @@ else if (packageableElement instanceof Root_meta_external_dataquality_DataQuali private static LambdaFunction generateModelConstraintLambda(PureModel pureModel, Integer queryLimit, Root_meta_external_dataquality_DataQuality packageableElement) { - if (Objects.isNull(queryLimit)) - { - return core_dataquality_generation_dataquality.Root_meta_external_dataquality_generateDataQualityQuery_DataQuality_1__Integer_MANY__LambdaFunction_1_(packageableElement, Lists.immutable.empty(), pureModel.getExecutionSupport()); - } - return core_dataquality_generation_dataquality.Root_meta_external_dataquality_generateDataQualityQuery_DataQuality_1__Integer_MANY__LambdaFunction_1_(packageableElement, Lists.immutable.of((long)queryLimit), pureModel.getExecutionSupport()); + return core_dataquality_generation_dataquality.Root_meta_external_dataquality_generateDataQualityQuery_DataQuality_1__Integer_$0_1$__LambdaFunction_1_(packageableElement, Objects.isNull(queryLimit) ? null : queryLimit.longValue(), pureModel.getExecutionSupport()); } private static LambdaFunction generateRelationValidationLambda(PureModel pureModel, Root_meta_external_dataquality_DataQualityRelationValidation packageableElement, String validationName, Boolean runQuery, Integer resultLimit) diff --git a/legend-engine-xts-dataquality/legend-engine-xt-dataquality-pure/src/main/resources/core_dataquality/generation/dataquality.pure b/legend-engine-xts-dataquality/legend-engine-xt-dataquality-pure/src/main/resources/core_dataquality/generation/dataquality.pure index 76d5d02706..ddfb8011f1 100644 --- a/legend-engine-xts-dataquality/legend-engine-xt-dataquality-pure/src/main/resources/core_dataquality/generation/dataquality.pure +++ b/legend-engine-xts-dataquality/legend-engine-xt-dataquality-pure/src/main/resources/core_dataquality/generation/dataquality.pure @@ -31,7 +31,7 @@ Class meta::external::dataquality::MilestoningContext }:Boolean[1]; } -function meta::external::dataquality::generateDataQualityQuery(dataquality:meta::external::dataquality::DataQuality[1], limit: Integer[*]): LambdaFunction[1] +function meta::external::dataquality::generateDataQualityQuery(dataquality:meta::external::dataquality::DataQuality[1], limit: Integer[0..1]): LambdaFunction[1] { generateDataQualityQuery($dataquality, $limit, true); } @@ -74,7 +74,7 @@ function meta::external::dataquality::addMilestoningParameters(tree:GraphFetchTr ]) } -function meta::external::dataquality::generateDataQualityQuery(dataquality:meta::external::dataquality::DataQuality[1], limit: Integer[*], useFrom:Boolean[1]): LambdaFunction[1] +function meta::external::dataquality::generateDataQualityQuery(dataquality:meta::external::dataquality::DataQuality[1], limit: Integer[0..1], useFrom:Boolean[1]): LambdaFunction[1] { $dataquality.validationTree->validateTreeForNestedConstraints(true); @@ -561,12 +561,12 @@ function meta::external::dataquality::buildFromRuntimeExpression(f: FunctionExpr functionName=from_T_m__Runtime_1__T_m_.name, importGroup=system::imports::coreImport, genericType=$returnType, - multiplicity=ZeroMany, - parametersValues=[$f, ^InstanceValue(values=$runtime->evaluateAndDeactivate(), genericType=^GenericType(rawType=NonExecutableValueSpecification), multiplicity=PureOne)]->evaluateAndDeactivate()); + multiplicity=$f.multiplicity, + parametersValues=[$f, ^InstanceValue(values=$runtime->evaluateAndDeactivate(), genericType=$runtime->genericType(), multiplicity=PureOne)]->evaluateAndDeactivate()); } function meta::external::dataquality::isFromFunctionPresent(func: FunctionDefinition[1]):Boolean[1] { let getExprList = $func->findExpressionsForFunctionInFunctionDefinition([meta::pure::mapping::from_T_m__Runtime_1__T_m_]); !$getExprList->isEmpty(); -} \ No newline at end of file +}