-
Notifications
You must be signed in to change notification settings - Fork 41
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
[6.0] GetVar(inputIndex, varId) for reading context variable from another input and fix for Context.getVar #1016
Conversation
/** | ||
* A variant of `getVar` to extract a context variable by id and type from any input | ||
* | ||
* @param inputId - input index |
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.
If it is index, then better call it inputIndex
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.
renamed
} else { | ||
an[Exception] should be thrownBy(varTest()) | ||
} | ||
} |
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.
Missing test case for different actual and expected types.
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.
Reworked into more nuanced check (for sigma.validation.ValidationException now)
reg1 -> UnitConstant.instance | ||
)) | ||
) | ||
} |
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.
What this test means?
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.
how is this test related to the PR ? Also, why to ask others about tests introduced by you (starting from 4f2579bbaeec )3def75d42629d7821073f39804b2 )
@aslesarenko comments addressed , please make another pass |
Co-authored-by: Alexander Slesarenko <aslesarenko@users.noreply.github.com>
Co-authored-by: Alexander Slesarenko <aslesarenko@users.noreply.github.com>
This PR contains:
fix for CONTEXT.getVar failing deserialization and compilation ( close Context.getVar failing compilation (and likely can't be deserialized) #978 )
CONTEXT.getVarFromInput method to read context variable from any input.
Note, that the new method is intentionally not throwing an exception on expected vs real types. This can be used to have
getVar
alternative without an exception, as in: