We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe. We have a context like this:
[{"QUESTIONARE":"SCHADEN.SACH"}, {"ROLLE":"VN"}, {"SCHILDERUNG":"bla."}, {"ROLLE2":"GES"}, {"SCHILDERUNG2":"blubber."}, {"ROLLE3":"VN"}, {"SCHILDERUNG3":"Palim."}, {"WASGANZANDERES":"blau"}, {"ANZAHL_KAPUTTE_STUEHLE":5}]
Filtering for QUESTIONARE works fine:
[{"QUESTIONARE":"SCHADEN.SACH"}, {"ROLLE":"VN"}, {"SCHILDERUNG":"bla."}, {"ROLLE2":"GES"}, {"SCHILDERUNG2":"blubber."}, {"ROLLE3":"VN"}, {"SCHILDERUNG3":"Palim."}, {"WASGANZANDERES":"blau"}, {"ANZAHL_KAPUTTE_STUEHLE":5}].QUESTIONARE[1]
But for another key (e.g. WASGANZANDERES) it fails. Reason for that being the fact that the keys are different in all given contexts.
WASGANZANDERES
Describe the solution you'd like The filter should work also on lists of contents with different keys.
If a context doesn't have the key then the list contains null for this context.
null
For the example, it should return:
// expression [{"QUESTIONARE":"SCHADEN.SACH"}, {"ROLLE":"VN"}, {"SCHILDERUNG":"bla."}, {"ROLLE2":"GES"}, {"SCHILDERUNG2":"blubber."}, {"ROLLE3":"VN"}, {"SCHILDERUNG3":"Palim."}, {"WASGANZANDERES":"blau"}, {"ANZAHL_KAPUTTE_STUEHLE":5}].WASGANZANDERES // result [null, null, null, null, null, null, null, "blue", null]
EDIT: updated the expected behavior based on the comment.
Related issues
The text was updated successfully, but these errors were encountered:
@McAlm thank you for reporting. 👍
Here is a simple example that demonstrates the issue:
[{x: 1}, {y: 2}].x
Not all contexts of the list have a key x.
x
It returns a list that contains an error. 🙈 If the expression access the second item, the evaluation fails with an error.
It returns a list that contains null if a context doesn't have this key.
[{x: 1}, {y: 2}].x // should return: // [1, null]
The expected behavior was discussed in the DMN TCK here.
Sorry, something went wrong.
@McAlm I updated the expected behavior in the description to align with the discussion in the DMN TCK.
It might not align with your expectations. The resulting list would return null values if the context doesn't contain the key.
If you want to access the first item that is not null, you would need to filter the list before.
For example:
my_list.WASGANZANDERES[item != null][1]
Does this work for you?
Closing this issue in favor of #674. This behavior is covered by the referenced issue.
No branches or pull requests
Is your feature request related to a problem? Please describe.
We have a context like this:
Filtering for QUESTIONARE works fine:
But for another key (e.g.
WASGANZANDERES
) it fails. Reason for that being the fact that the keys are different in all given contexts.Describe the solution you'd like
The filter should work also on lists of contents with different keys.
If a context doesn't have the key then the list contains
null
for this context.For the example, it should return:
EDIT: updated the expected behavior based on the comment.
Related issues
The text was updated successfully, but these errors were encountered: