-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
If we have a condition: cnd = Value.dtype.equal_to(str), we can test a datum like this: cnd.test('hello') -> bool. But if we have a rule with an empty path argument:
rule = Rule(path=[], condition=cnd)...we cannot test a scalar datum in the same way:
rule.test('hello') # raises TypeError...because we cast "hello" to a Data object, which expects a list or dict.
The workaround is to wrap the datum in a list and set the path to the first list element, like this:
rule = Rule(path=[0], condition=cnd)
rule.test(["hello"]) # successMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working