kumarUjjawal commented on code in PR #18699:
URL: https://github.com/apache/datafusion/pull/18699#discussion_r2527879518


##########
datafusion/optimizer/src/push_down_filter.rs:
##########
@@ -1361,18 +1363,15 @@ fn insert_below(
 ) -> Result<Transformed<LogicalPlan>> {
     let mut new_child = Some(new_child);
     let transformed_plan = plan.map_children(|_child| {
-        if let Some(new_child) = new_child.take() {
-            Ok(Transformed::yes(new_child))
-        } else {
-            // already took the new child
-            internal_err!("node had more than one input")
-        }
+        assert_or_internal_err!(new_child.is_some(), "node had more than one 
input");
+        let Some(new_child) = new_child.take() else {
+            unreachable!("checked Some via assert_or_internal_err!");
+        };
+        Ok(Transformed::yes(new_child))

Review Comment:
   Got it!



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to