-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor: Encapsulate return_type
and signature
in AggregateFunction
and WindowFunction
#6748
Minor: Encapsulate return_type
and signature
in AggregateFunction
and WindowFunction
#6748
Conversation
5728dae
to
9d0c676
Compare
@@ -246,10 +276,10 @@ mod tests { | |||
#[test] | |||
fn test_count_return_type() -> Result<()> { | |||
let fun = find_df_window_func("count").unwrap(); | |||
let observed = return_type(&fun, &[DataType::Utf8])?; | |||
let observed = fun.return_type(&[DataType::Utf8])?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically shows the new API -- use a method on the fun
rather than have to find a free function
return_type
and signature
in `return_type
and signature
in AggregateFunction
and WindowFunction
&self.signature(), | ||
)?; | ||
|
||
match self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is now indented one level more -- there are no logical changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @alamb
Thank you for the review @jackwener |
Reviewing the PR with whitespace blind diff I think makes it easier to see what is going on: #6748
This is a very small logical change, but since it changes the indent level the textual change is significant
Which issue does this PR close?
Follow on to #6612
Rationale for this change
This has been a pet peeve of mine and I think it makes working with this code harder than needed as finding important functionality like "what is the signature of this function" harder because they aren't documented on https://docs.rs/datafusion-expr/26.0.0/datafusion_expr/window_function/enum.WindowFunction.html or https://docs.rs/datafusion-expr/26.0.0/datafusion_expr/aggregate_function/enum.AggregateFunction.html
What changes are included in this PR?
signature
,return_type
to functions onWindowFunction
andBuiltInWindowFunction
andAggregateFunction
Are these changes tested?
existing coverage
Are there any user-facing changes?
Hopefully easier to navigate code
There is no API change as the existing methods still exist, they are just deprecated