alamb commented on code in PR #13491:
URL: https://github.com/apache/datafusion/pull/13491#discussion_r1853770380
##########
datafusion/expr/src/udf.rs:
##########
@@ -546,7 +546,7 @@ pub trait ScalarUDFImpl: Debug + Send + Sync {
/// to arrays, which will likely be simpler code, but be slower.
fn invoke_with_args(&self, args: ScalarFunctionArgs) ->
Result<ColumnarValue> {
#[allow(deprecated)]
Review Comment:
we cam probably remove this #allow as well
##########
datafusion/functions/src/utils.rs:
##########
@@ -170,7 +171,8 @@ pub mod test {
}
else {
// invoke is expected error - cannot use .expect_err()
due to Debug not being implemented
- match
func.invoke_with_args(datafusion_expr::ScalarFunctionArgs{args: $ARGS,
number_rows: cardinality, return_type: &return_type.unwrap()}) {
+ #[allow(deprecated)]
Review Comment:
likewise here -- invoke_with_args
##########
datafusion/functions/src/utils.rs:
##########
@@ -149,7 +149,8 @@ pub mod test {
let return_type = return_type.unwrap();
assert_eq!(return_type, $EXPECTED_DATA_TYPE);
- let result =
func.invoke_with_args(datafusion_expr::ScalarFunctionArgs{args: $ARGS,
number_rows: cardinality, return_type: &return_type});
+ #[allow(deprecated)]
Review Comment:
It seems like it would be good to keep calling using `invoke_with_args`
##########
datafusion/functions/src/datetime/date_bin.rs:
##########
@@ -181,30 +185,6 @@ Calculates time intervals and returns the start of the
interval nearest to the s
For example, if you "bin" or "window" data into 15 minute intervals, an input
timestamp of `2023-01-01T18:18:18Z` will be updated to the start time of the 15
minute bin it is in: `2023-01-01T18:15:00Z`.
"#)
.with_syntax_example("date_bin(interval, expression,
origin-timestamp)")
- .with_sql_example(r#"```sql
Review Comment:
why was this removed?
##########
docs/source/user-guide/sql/scalar_functions.md:
##########
@@ -1954,32 +1954,6 @@ The following intervals are supported:
- years
- century
-#### Example
Review Comment:
I think it is because you removed the docs (perhaps accidentally) above -- i
left a comment
##########
datafusion/functions/benches/make_date.rs:
##########
@@ -91,13 +101,15 @@ fn criterion_benchmark(c: &mut Criterion) {
let mut rng = rand::thread_rng();
let year = ColumnarValue::Scalar(ScalarValue::Int32(Some(2025)));
let month = ColumnarValue::Scalar(ScalarValue::Int32(Some(11)));
- let days = ColumnarValue::Array(Arc::new(days(&mut rng)) as ArrayRef);
+ let day_arr = Arc::new(days(&mut rng));
+ let batch_len = day_arr.len();
+ let days = ColumnarValue::Array(day_arr);
b.iter(|| {
#[allow(deprecated)] // TODO use invoke_batch
Review Comment:
comments could be updated (todo removed)
##########
datafusion/functions/benches/ltrim.rs:
##########
@@ -141,8 +141,8 @@ fn run_with_string_type<M: Measurement>(
),
|b| {
b.iter(|| {
- #[allow(deprecated)] // TODO use invoke_batch
- black_box(ltrim.invoke(&args))
+ #[allow(deprecated)] // TODO use invoke_with_args
Review Comment:
likewise here I think we can remove the #allow
--
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]