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

Restore is empty functions as before #1657

Merged
merged 2 commits into from
Apr 4, 2023

Conversation

generall
Copy link
Member

@generall generall commented Apr 4, 2023

Is Empty

  • This condition will match all records where the field reports either does not exist, or have NULL or [] value.

// { "a": [ { "b": null }, { "b": 1 } ] } => true
// { "a": [ { "b": 1 }, { "b": null } ] } => true
// { "a": [ { "b": 1 }, { "b": 2 } ] } => false
MultiValue::Multiple(vals) => vals.iter().any(|val| val.is_null()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand you are trying to handle the case with duplicated keys with null.

Don't we need to check the keys as well?

What about?

{ "a": [ { "b": null }, { "b": 1 }, {"c": 2} ] }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be is_null, I think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I got it, you are referring to matching a.b not the array a.

@generall generall merged commit b733352 into dev Apr 4, 2023
generall added a commit that referenced this pull request Apr 11, 2023
* is_empty should match with value=null

* fmt
@generall generall mentioned this pull request Apr 19, 2023
8 tasks
@agourlay agourlay deleted the restore-is-empty-functions-as-before branch July 12, 2023 15:47
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 this pull request may close these issues.

2 participants