Open jordanrfrazier opened 1 year ago
Possibly related - I've seen cases where these produce different results:
foo | when(p1) | when(p2)
foo | when(p1 and p2)
This may be more predictable if we only produce discrete values where the RHS is defined at the time of the LHS (ie, don't fabricate null rows)
Description
when(condition)
is expected to filter out rows where the condition isfalse
ornull
. This happens as expected; however, if the output of awhen
is merged with rows at the same time, something seems to be populating that output value as a non-null value (I think, the last non-null value, implying that themerge
is caching the value incorrectly. Interpolation issue, perhaps?).To Reproduce Steps to reproduce the behavior:
when_tests.rs
:test_when_output_resets_to_null
.Actual Behavior The results show:
Expected Behavior Expected the value of
count_when_valid
to benull
when thepurchase_is_valid
value is eithernull
orfalse
.Additional context
when
produces discrete values, meaning that we should not be caching the last non-null value anywhere. Running the test just with the final feature illustrates the difference: