crepererum commented on code in PR #12076:
URL: https://github.com/apache/datafusion/pull/12076#discussion_r1723450810


##########
datafusion/physical-plan/src/windows/mod.rs:
##########
@@ -283,7 +283,11 @@ fn create_built_in_window_expr(
                 args[1]
                     .as_any()
                     .downcast_ref::<Literal>()
-                    .unwrap()
+                    .ok_or_else(|| {
+                        DataFusionError::Execution(
+                            format!("Expected a signed integer literal for the 
second argument of nth_value, got {}", args[1]),
+                        )

Review Comment:
   ```suggestion
                           exec_datafusion_err!("Expected a signed integer 
literal for the second argument of nth_value, got {}", args[1])
   ```
   
   avoids the format call and wires up the backtrace. You may need to import it 
from here though:
   
   
https://github.com/apache/datafusion/blob/37e54ee874e9027a329ba4f6c1e0e6359d63a33c/datafusion/common/src/error.rs#L545-L546
   
   PS: I should have caught that during the first round of reviews, sorry.



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to