Skip to content

add ok() / is_ok() and replace error("missing") with none handling - #7288

Open
mccanne wants to merge 2 commits into
mainfrom
no-error-missing
Open

add ok() / is_ok() and replace error("missing") with none handling#7288
mccanne wants to merge 2 commits into
mainfrom
no-error-missing

Conversation

@mccanne

@mccanne mccanne commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

This commit is the first step toward getting rid of error("missing") and handling these conditions with proper none expressions. There are still quite a few instances of missing values being created but they will be removed in a subsequent PR where we take out vector.NewMissing().

We introduced the Rust idioms ok() and is_ok(). We removed the has() and missing() functions and replaced has() with is_ok(). We replaced quiet() with ok().

There are currently some problems with SQL errors since we relied upon error("missing") semantics to avoid reporting errors based on the hidden paths representing SQL relations. We disabled some problematic tests and will fix the problem and re-enabled the tests in a subsequent PR.

We also wired up rungen to generate path references that use the field.Chain noneish parameters so the "?." dereferencing operator works correctly.

This commit is the first step toward getting rid of error("missing")
and handling these conditions with proper none expressions.  There are
still quite a few instances of missing values being created but they
will be removed in a subsequent PR where we take out vector.NewMissing().

We introduced the Rust idioms ok() and is_ok().  We removed the has()
and missing() functions and replaced has() with is_ok().  We replaced
quiet() with ok().

There are currently some problems with SQL errors since we relied upon
error("missing") semantics to avoid reporting errors based on the
hidden paths representing SQL relations.  We disabled some problematic
tests and will fix the problem and re-enabled the tests in a subsequent PR.

We also wired up rungen to generate path references that use the
field.Chain noneish parameters so the "?." dereferencing operator
works correctly.
data: |
fn 0/h(e): (
has(e)
len(e)!=0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Wait why is this not ok(e)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It could be is_ok but semantic changes that to ok(e)!=none which is fine but the point of the test was to test implied where for boolean udf so it doesn't matter.

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