spec icon indicating copy to clipboard operation
spec copied to clipboard

Clarify whether missing attributes should return an `error` or `false`

Open Cali0707 opened this issue 2 years ago • 5 comments

Currently, when evaluating a CESQL expression with a missing attribute we return an error. However, the spec does not specify whether we should return an error or whether we should return false in this case. The convention of returning an error is coming from the tck tests, which have a missingAttribute error.

From conversation on slack there is a suggestion to return false instead of a missingAttribute error when there is a missing attribute in a CESQL expression.

Regardless of the decision to return an error or false, the behaviour should be clarified in the spec. Hence, the scope of this issue is to:

  1. Decide whether error or false should be the result of a missing attribute in a CESQL expression
  2. Clarify the spec to explain the result

Cali0707 avatar Sep 25 '23 15:09 Cali0707

This issue is stale because it has been open for 30 days with no activity. Mark as fresh by updating e.g., adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Oct 26 '23 01:10 github-actions[bot]

@duglin could you assign this to me?

Cali0707 avatar Feb 02 '24 15:02 Cali0707

done

duglin avatar Feb 02 '24 18:02 duglin

Interesting, from the spec it seems like:

When addressing an attribute not included in the input event, an empty String MUST be assumed as its value.

IMO this seems reasonable, and would fix a lot of the problems that the current implementations have regarding errors, where it is unclear whether or not you would get an error as it depends on whether or not AND and OR are optimized to return early.

@duglin @pierDipi what do you think of adding a clarification to the 3.3 Errors section that states that Addressing an attribute which is missing from the input event MUST not return an error. ?

We could then update the tck tests to reflect this, and fix SDKs

Cali0707 avatar Feb 02 '24 20:02 Cali0707

I agree

pierDipi avatar Feb 05 '24 08:02 pierDipi