Closed rwspielman closed 2 years ago
Yeah I don't think string concatenation is supported now or ever has been (as in this isn't a regression). You're right about the way it'd be implemented would involve creating an AddExpression
that inherits from LeftOperatorRightExpressionBase
then handling strings and numbers together.
@zeroSteiner thanks for the quick reply. I'm gonna work on it this morning and submit a PR shortly
Hey Spencer (and community),
Is it possible to join strings? I've tried the obvious method of
'a'+'b'
but that results in datatype mismatch from this func https://github.com/zeroSteiner/rule-engine/blob/1d84d5599fe5ab34bc8d6fc00bbe00f847352428/lib/rule_engine/ast.py#L373-L378Couldn't find any custom operators for text joining. Happy to submit a PR if there is no way to do this currently. Strategy would be to remove
operator.add
from this class into its own, changing the validation method to either combination ofstring and string
ornum and num
https://github.com/zeroSteiner/rule-engine/blob/1d84d5599fe5ab34bc8d6fc00bbe00f847352428/lib/rule_engine/ast.py#L369-L386