-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: Allow inspection/manipulation of record when all fields are null #725
Comments
This produces the correct results: (Commented out the extra extend user)
|
Whereas with the extend user, it is creating a new Specifically in operation 3, expression 15, we create a new record that will never be null. Thus in the |
If I'm reading that correctly this is (as speculated on the PR) not a bug, but rather due to the fact that a It seems like changing the behavior to treat a record of all The other option would be to change the behavior of |
It is not necessarily a bug in the sense that expressions are executing as we have defined the current behavior, yes. I'm not sure what I would expect here, but I would consider changing records to be I would understand if user's generally follow the pattern below:
Of course it can be worked around by accessing fields, but I think just the presence of a method like |
We almost centaily should not change records of all https://trinket.io/python/f7ad7f9864 Changing it to be Note this is actually different from "coalesce but treat all null as null". Instead, this is "coalesce, but applied to each field in the record". This would also be useful in cases where you had parts of a record filled in on one side and parts not filled in on the other. Note that with that behavior, if the first record is "all nulls" then the fields from the second would be taken, so it would effectively be the same as "coalesce but treat all null as null", but it would also support other use patterns (and wouldn't lead to any "null means different things in different places". |
else
is creating empty records in certain cases
Summary
This behavior was first noticed in the the test described in #682, where it was expected that using
coalesce
would pick the secondrecord
, but it always gets the first.When a
record
is created during execution, it will always be non-null, even if all fields are null. This is expected behavior (links?). In the below query, theextend
creates a new record and thus thecoalesce
(which comes from the_else
) always chooses that first record.Feature Request
This use case may be summarized as
null
, I want to use record B hereafter.See Ben's latest comment for suggestions on how we may want to implement this existing behavior.
The text was updated successfully, but these errors were encountered: