-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Canonicalize variable in object creation or copy if variable is a stream #649
Conversation
CallServiceModel( | ||
LiteralModel("\"json\"", ScalarType.string), | ||
"obj", | ||
CallModel( | ||
args, | ||
CallModel.Export(result.name, result.`type`) :: Nil | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move that pattern to a function so it's more readable? I see you do service calls like that in a few places.
Something like this might be nice (pseudocode)
def callService(service: String, function: String, args: HList) -> CallServiceModel = {
CallServiceModel(LiteralModel(s"\"$service\"", ScalarType.string), function, args)
}
ldfixed <- canonicalizeIfStream(ld._1, ld._2) | ||
rdfixed <- canonicalizeIfStream(rd._1, rd._2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ldfixed <- canonicalizeIfStream(ld._1, ld._2) | |
rdfixed <- canonicalizeIfStream(rd._1, rd._2) | |
ldCanon <- canonicalizeIfStream(ld._1, ld._2) | |
rdCanon <- canonicalizeIfStream(rd._1, rd._2) |
val copyOp = CallServiceModel( | ||
LiteralModel("\"json\"", ScalarType.string), | ||
"puts", | ||
CallModel( | ||
value +: args, | ||
CallModel.Export(result.name, result.`type`) :: Nil | ||
) | ||
).leaf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, def callService
might make this more readable
fixes LNG-112