carloea2 commented on code in PR #8242:
URL: https://github.com/apache/texera/pull/8242#discussion_r4369005964


##########
amber/src/main/python/core/architecture/sendsemantics/hash_based_shuffle_partitioner.py:
##########
@@ -28,6 +28,8 @@
 
 
 class HashBasedShufflePartitioner(IndexedShufflePartitioner):
+    _clear_batch_on_flush = True

Review Comment:
   Removed the flag. The base class now always drains emitted batches. All 37 
partitioner tests pass.



##########
amber/src/main/python/core/architecture/sendsemantics/hash_based_shuffle_partitioner.py:
##########
@@ -28,6 +28,8 @@
 
 
 class HashBasedShufflePartitioner(IndexedShufflePartitioner):
+    _clear_batch_on_flush = True

Review Comment:
   Removed the stale comment along with the flag.



##########
amber/src/test/python/core/architecture/sendsemantics/test_partitioners.py:
##########
@@ -289,15 +289,14 @@ def 
test_flush_emits_pending_batch_and_ecm_for_target_only(self):
         ecm = EmbeddedControlMessage()
         a_out = _snapshot(p.flush(p.receivers[0][0], ecm))
         assert a_out == [[_hashable_tuple(k=1)], ecm]
+        assert p.receivers[0][1] == []
 
-    def test_flush_does_not_clear_the_flushed_slot(self):
-        # Hash/range shuffles leave a flushed slot's batch intact
-        # (_clear_batch_on_flush=False), unlike round-robin.
+    def test_flush_clears_the_flushed_slot(self):
         p = self._partitioner(batch_size=10)
         p.receivers[0] = (p.receivers[0][0], [_hashable_tuple(k=1)])
         ecm = EmbeddedControlMessage()
         list(p.flush(p.receivers[0][0], ecm))
-        assert p.receivers[0][1] == [_hashable_tuple(k=1)]
+        assert p.receivers[0][1] == []

Review Comment:
   Replaced the duplicate assertion with a double-flush check. It also verifies 
that the other receiver keeps its pending rows.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to