Giter VIP home page Giter VIP logo

Comments (4)

barmac avatar barmac commented on August 22, 2024 2

I brought this issue up in the DMN 1.5 RTF meeting today. We looked together into the specification and agreed that it's sufficiently specified. On page 109, one can read:

The filter expression is evaluated for each item in list, and a list containing only items where the filter expression is true is returned. E.g:
[ {x:1, y:2}, {x:null, y:3} ][x < 2] = [{x:1, y:2}]

So for the third element, the evaluated filter is:

{ b: 1 }.a < 3

// which is equal to
null < 3

// which results in
null

As null != true, the filter expression should drop the item.

As a follow-up, we should create a PR with a test case which ensures the behavior above between the implementations.

from tck.

nikku avatar nikku commented on August 22, 2024

Thanks for clarifying @barmac.

I can see if I can add a TCK test case to cover two topics that you mention:

// access of undefined members in a Context
{ x: 1 }.y = null
// filtering of lists on undefined members
[ { x: 1 } ][y > 1] = []

[ { x: 1 }, { y: 2 } ][y > 1] = [ { y: 2 } ]

from tck.

opatrascoiu avatar opatrascoiu commented on August 22, 2024

Before adding new tests please check if the existing ones do not cover your use case.

from tck.

nikku avatar nikku commented on August 22, 2024

Writing test cases for this you could argue that the spec is "underspecified", because each of the provided list member contexts have actual members with the given name.

#540 attempts to create test cases for all cases covered by the spec (10.3.2.5 Lists and filters), and also adds cases discussed in this issue (non-member access).

At the same time #541 asserts the behavior of non-member context access.

from tck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.