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

is_valid: Remove support for arrays #440

Closed
LukeWeidenwalker opened this issue May 5, 2023 · 2 comments
Closed

is_valid: Remove support for arrays #440

LukeWeidenwalker opened this issue May 5, 2023 · 2 comments

Comments

@LukeWeidenwalker
Copy link
Contributor

LukeWeidenwalker commented May 5, 2023

Process ID: is_valid

Describe the issue:
In order for is_valid to be applicable across a dimension of a datacube through a reducer, we cannot fulfil the requirement
is_valid(x = [null,null]) => true, because under the hood the dimension ends up being an array too, so is_valid(x = [null,null]) => [False, False]. Removing support for checking validity of arrays would make our implementation easier. My impression is that the purpose of is_valid is to filter array elements anyways, so don't think this would be very detrimental at all to the utility of this process.

Proposed solution:
Update the schema for x to something like:

"type": [
    "number",
    "boolean",
    "string",
    "object",
    "null"
]

An optional extension would be to also drop support for object.

Additional context:
We've already removed support for arrays and objects from comparisons in #422

@LukeWeidenwalker LukeWeidenwalker changed the title is_valid: Remove support for arrays and objects is_valid: Remove support for arrays May 5, 2023
@LukeWeidenwalker
Copy link
Contributor Author

Apologies, the labels bug and patch got added automatically, don't mean to suggest this is a bug!

@m-mohr
Copy link
Member

m-mohr commented May 5, 2023

@LukeWeidenwalker I think you are misunderstanding the example. Please keep in mind you don't need to check the array content. An array or object is always valid data: "Thus all arrays, objects and strings are valid, regardless of their content."

@m-mohr m-mohr closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants