Skip to content

Commit aa519e6

Browse files
hack deferred value fix
1 parent e7c4eb4 commit aa519e6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

bigframes/core/compile/compiled.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,9 @@ def project_window_op(
474474
else:
475475
# Operations like count treat even NULLs as valid observations for the sake of min_periods
476476
# notnull is just used to convert null values to non-null (FALSE) values to be counted
477+
is_observation = ops.notnull_op.as_expr(expression.inputs[0])
477478
observation_count_expr = agg_expressions.WindowExpression(
478-
agg_ops.size_op.as_expr(),
479+
agg_ops.count_op.as_expr(is_observation),
479480
window_spec,
480481
)
481482
clauses.append(

third_party/bigframes_vendored/ibis/expr/types/generic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,9 @@ def over(
773773

774774
@deferrable
775775
def bind(table):
776-
winfunc = rewrite_window_input(node, window.bind(table))
776+
winfunc = rewrite_window_input(
777+
node, window.bind(table) if table else window
778+
)
777779
if winfunc == node:
778780
raise com.IbisTypeError(
779781
"No reduction or analytic function found to construct a window expression"
@@ -782,7 +784,7 @@ def bind(table):
782784

783785
try:
784786
return bind(table)
785-
except com.IbisInputError:
787+
except com.IbisInputError as e:
786788
return bind(_)
787789

788790
def isnull(self) -> ir.BooleanValue:

0 commit comments

Comments
 (0)