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
Fix parsing of floats in $apply/aggregate/average expression #1811
Fix parsing of floats in $apply/aggregate/average expression #1811
Conversation
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.
LGTM
@@ -40,6 +40,9 @@ internal class FakeBindMethods | |||
public static readonly SingleValueNode FakeSingleIntPrimitive = | |||
new ConstantNode(100); | |||
|
|||
public static readonly SingleValueNode FakeSingleSinglePrimitive = |
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.
Even though a float is EdmPrimitiveTypeKind.Single
, Maybe for a better description, you could have used FakeSingleFloatPrimitive
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.
I could do that
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.
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.
🚀
b724cb5
to
d14b757
Compare
Issues
This pull request fixes issue #1809.
Description
Fixes a bug where
ApplyBinder
does not cater for float/single for the average aggregate method. This causes the following average expression to be rejected:while related sum, min, and max are accepted
Note: The return value from averaging floats should be a float
https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.average?view=netcore-3.1#System_Linq_Enumerable_Average__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Single__
https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.average?view=netcore-3.1#System_Linq_Enumerable_Average__1_System_Collections_Generic_IEnumerable___0__System_Func___0_System_Nullable_System_Single___
Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.