Skip to content

Commit dd67dd2

Browse files
committed
Revert "Reapply "fix the kokoro issue with unreliable row count""
This reverts commit a6bc2c5.
1 parent a6bc2c5 commit dd67dd2

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

bigframes/core/rewrite/slices.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,6 @@ def rewrite_slice(node: nodes.BigFrameNode):
7676
return node
7777

7878
slice_def = (node.start, node.stop, node.step)
79-
80-
# Handle empty slice cases explicitly before any row count dependent logic
81-
# This ensures empty slices always return empty results regardless of statistics
82-
if _is_empty_slice(node.start, node.stop, node.step):
83-
# Create a filter that will always return empty results
84-
# Use start=0, stop=0, step=1 to ensure empty result
85-
return slice_as_filter(node.child, 0, 0, 1)
86-
8779
# no-op (eg. df[::1])
8880
if slices.is_noop(slice_def, node.child.row_count):
8981
return node.child
@@ -97,26 +89,6 @@ def rewrite_slice(node: nodes.BigFrameNode):
9789
return slice_as_filter(node.child, *slice_def)
9890

9991

100-
def _is_empty_slice(start, stop, step):
101-
"""Check if a slice will always return empty results."""
102-
if start is None or stop is None:
103-
return False
104-
105-
# Normalize step
106-
if step is None:
107-
step = 1
108-
109-
# For positive step, empty if start >= stop
110-
# For negative step, empty if start <= stop
111-
if step > 0:
112-
return start >= stop
113-
elif step < 0:
114-
return start <= stop
115-
else:
116-
# step == 0 is invalid, but handle gracefully
117-
return True
118-
119-
12092
def slice_as_filter(
12193
node: nodes.BigFrameNode, start: Optional[int], stop: Optional[int], step: int
12294
) -> nodes.BigFrameNode:

0 commit comments

Comments
 (0)