Open aormerod-gs opened 1 year ago
https://github.com/finos/legend-pure/blob/cbf7fcef2ecd76a8e1e82afd85431c3d613dc9a7/legend-pure-m3-core/src/main/java/org/finos/legend/pure/m3/compiler/validation/functionExpression/GetAllValidator.java#L73
Currently the method checks that the business date is a constant or a VariableExpression, expecting use cases of
MyClass.all(%2015-01-01)
or
let businessDate = today(); MyClass.all($businessDate );
However it gives compiler usage like
let businessDate = today(); MyClass.all($businessDate ) ->concatenate(MyClass.all($businessDate->adjust(-1, DurationUnit.DAYS));
due to the parameter being a FunctionExpression.
Although people can still create an equivalent query via:
let businessDate = today(); MyClass.all($businessDate ) ->concatenate({d:Date[1]|MyClass.all($d)}->eval($businessDate->adjust(-1, DurationUnit.DAYS));
and the compiler won't complain (but it's more complicated to write / less clear)
https://github.com/finos/legend-pure/blob/cbf7fcef2ecd76a8e1e82afd85431c3d613dc9a7/legend-pure-m3-core/src/main/java/org/finos/legend/pure/m3/compiler/validation/functionExpression/GetAllValidator.java#L73
Currently the method checks that the business date is a constant or a VariableExpression, expecting use cases of
or
However it gives compiler usage like
due to the parameter being a FunctionExpression.
Although people can still create an equivalent query via:
and the compiler won't complain (but it's more complicated to write / less clear)