-
Notifications
You must be signed in to change notification settings - Fork 8
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
KXI-59012 Make structuredText results easier for consumers to use #507
Conversation
resources/evaluate.q
Outdated
@@ -147,7 +147,7 @@ | |||
originalType ~ `chars; | |||
`chars; | |||
.axq.i_NONPRIMCODE type data]; | |||
values: ('[removeTrailingNewline; toString] each data); | |||
values: enlist ('[removeTrailingNewline; toString] each data); | |||
values: $[type values = 11h; enlist values; values]; |
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.
Since we always enlist values in the previous line, line 151 may be removed.
resources/evaluate.q
Outdated
@@ -173,7 +173,7 @@ | |||
(generateColumns[::;0b;1b;key data;"key"]; generateColumns[::;0b;0b;value data;"values"]); | |||
isTable; | |||
generateTableColumns[originalType;isAtom;0b;data]; | |||
generateColumns[originalType;isAtom;0b;data;$[isAtom;"value";"values"]] | |||
generateColumns[originalType;isAtom;0b;data;"values"] |
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.
Line 176 not always generates an array as stated in the ticket. (enlist
is missing).
@acheung12 Please also check https://kxl.atlassian.net/browse/KXI-59118?focusedCommentId=842163 |
Tested the code above and from the insights and the conclusion is: In my change before, the code works as if for the following case: If the values attribute is not an array, it will be converted into an array of length 1 containing the value. With your changes, if the values attribute is not an array, convert to array, if this is an array already, convert it to an array with length 1 of an array |
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.
as explained in my comment, the idea is: if is array, remain unchanged. if is not array, convert to an array
This also could be used to columns as well
Made the requested changes. |
Changes introduced by this PR