Skip to content
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

Clarify whether missing attributes should return an error or false #1230

Closed
Cali0707 opened this issue Sep 25, 2023 · 5 comments · Fixed by #1257
Closed

Clarify whether missing attributes should return an error or false #1230

Cali0707 opened this issue Sep 25, 2023 · 5 comments · Fixed by #1257
Assignees

Comments

@Cali0707
Copy link
Contributor

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
@github-actions
Copy link

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.

@Cali0707
Copy link
Contributor Author

Cali0707 commented Feb 2, 2024

@duglin could you assign this to me?

@duglin
Copy link
Collaborator

duglin commented Feb 2, 2024

done

@Cali0707
Copy link
Contributor Author

Cali0707 commented Feb 2, 2024

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

@pierDipi
Copy link
Member

pierDipi commented Feb 5, 2024

I agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants