-
Notifications
You must be signed in to change notification settings - Fork 491
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
Documenting function parameter types and returns #1071
Conversation
This addresses #1026 |
|
||
Change the NaN value during binary operations (when joining two queries) of unknown groups to the scalar. This is useful to prevent unknown group and other errors from bubbling up. | ||
|
||
## sort(number, asc_desc) | ||
## sort(numberSet, asc_desc string) numberSet |
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.
Should we have a format when strings have a predefined set of values. So for sort the asc desc, lsstat is has a set as well.
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'm not sure how to define it. The description makes it pretty clear what to do.
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.
something like regex syntax: /"(asc|desc)"/
or Powershell validation sets: [ValidateSet("Steve","Mary")]
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.
And I disagree that the description is clear. You should be able to call a function knowing only it's signature, and asc_desc is not a defined type. If you want to do that you should do what .NET and Go do and use enums or consts instead of strings
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 like the Piped version (Minus the escapes and quotes, so
(asc|desc) string
On Mon, Jun 15, 2015 at 3:40 PM, Greg Bray notifications@github.com wrote:
In docs/expressions.md
#1071 (comment):Change the NaN value during binary operations (when joining two queries) of unknown groups to the scalar. This is useful to prevent unknown group and other errors from bubbling up.
-## sort(number, asc_desc)
+## sort(numberSet, asc_desc string) numberSetsomething like regex syntax: "(asc|desc)"\
or Powershell validation sets: [ValidateSet("Steve","Mary")]
—
Reply to this email directly or view it on GitHub
https://github.com/bosun-monitor/bosun/pull/1071/files#r32475366.
@captncraig Looking good - much appreciated. Ship at will |
Agreed... looks much better! Great work! |
Documenting function parameter types and returns
This also includes formally renaming Number to NumberSet to cause less confusion.