alamb commented on code in PR #16391: URL: https://github.com/apache/datafusion/pull/16391#discussion_r2145088320
########## datafusion/functions-table/src/generate_series.rs: ########## @@ -197,11 +197,17 @@ impl TableFunctionImpl for GenerateSeriesFuncImpl { } let mut normalize_args = Vec::new(); - for expr in exprs { + for (expr_indice, expr) in exprs.iter().enumerate() { Review Comment: I think `index` is a more standard singular form of `indices` so like ```suggestion for (expr_index, expr) in exprs.iter().enumerate() { ``` ########## datafusion/functions-table/src/generate_series.rs: ########## @@ -197,11 +197,17 @@ impl TableFunctionImpl for GenerateSeriesFuncImpl { } let mut normalize_args = Vec::new(); - for expr in exprs { + for (expr_indice, expr) in exprs.iter().enumerate() { match expr { Expr::Literal(ScalarValue::Null, _) => {} Expr::Literal(ScalarValue::Int64(Some(n)), _) => normalize_args.push(*n), - _ => return plan_err!("First argument must be an integer literal"), + other => { + return plan_err!( + "Argument #{} must be an integer literal or null value, got {:?}", Review Comment: I don' have any good suggestions I do think the `{:?}` might be hard to read for complex expressions. Maybe you could change this to have the display name instead. Something like ```suggestion "Argument #{} must be an integer literal or null value, got {} ({:?})", expr_index, other, other, ``` -- 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