- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.7k
          Add DocumentationBuilder::with_standard_argument to reduce copy/paste
          #12747
        
          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
          
     Merged
      
      
    
  
     Merged
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            6 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      12869e8
              
                Add `DocumentationBuilder::with_standard_expression` to reduce copy/p…
              
              
                alamb 6445318
              
                fix doc
              
              
                alamb 3e816e1
              
                fix standard argument
              
              
                alamb ced40d2
              
                Update docs
              
              
                alamb 8a75ed0
              
                Merge remote-tracking branch 'apache/main' into alamb/less_boilerplate
              
              
                alamb 09a4b7b
              
                Improve documentation to explain what is different
              
              
                alamb File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -142,10 +142,7 @@ fn get_bit_and_doc() -> &'static Documentation { | |
| .with_doc_section(DOC_SECTION_GENERAL) | ||
| .with_description("Computes the bitwise AND of all non-null input values.") | ||
| .with_syntax_example("bit_and(expression)") | ||
| .with_argument( | ||
| "expression", | ||
| "Expression to operate on. Can be a constant, column, or function, and any combination of arithmetic operators.", | ||
| ) | ||
| .with_standard_argument("expression", "Integer") | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea is to reduce this the boiler plate here | ||
| .build() | ||
| .unwrap() | ||
| }) | ||
|  | @@ -159,10 +156,7 @@ fn get_bit_or_doc() -> &'static Documentation { | |
| .with_doc_section(DOC_SECTION_GENERAL) | ||
| .with_description("Computes the bitwise OR of all non-null input values.") | ||
| .with_syntax_example("bit_or(expression)") | ||
| .with_argument( | ||
| "expression", | ||
| "Expression to operate on. Can be a constant, column, or function, and any combination of arithmetic operators.", | ||
| ) | ||
| .with_standard_argument("expression", "Integer") | ||
| .build() | ||
| .unwrap() | ||
| }) | ||
|  | @@ -174,12 +168,11 @@ fn get_bit_xor_doc() -> &'static Documentation { | |
| BIT_XOR_DOC.get_or_init(|| { | ||
| Documentation::builder() | ||
| .with_doc_section(DOC_SECTION_GENERAL) | ||
| .with_description("Computes the bitwise exclusive OR of all non-null input values.") | ||
| .with_syntax_example("bit_xor(expression)") | ||
| .with_argument( | ||
| "expression", | ||
| "Expression to operate on. Can be a constant, column, or function, and any combination of arithmetic operators.", | ||
| .with_description( | ||
| "Computes the bitwise exclusive OR of all non-null input values.", | ||
| ) | ||
| .with_syntax_example("bit_xor(expression)") | ||
| .with_standard_argument("expression", "Integer") | ||
| .build() | ||
| .unwrap() | ||
| }) | ||
|  | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -47,7 +47,7 @@ bit_and(expression) | |
|  | ||
| #### Arguments | ||
|  | ||
| - **expression**: Expression to operate on. Can be a constant, column, or function, and any combination of arithmetic operators. | ||
| - **expression**: Integer expression to operate on. Can be a constant, column, or function, and any combination of operators. | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the arithmetic is superflous in this context | ||
|  | ||
| ### `bit_or` | ||
|  | ||
|  | @@ -59,7 +59,7 @@ bit_or(expression) | |
|  | ||
| #### Arguments | ||
|  | ||
| - **expression**: Expression to operate on. Can be a constant, column, or function, and any combination of arithmetic operators. | ||
| - **expression**: Integer expression to operate on. Can be a constant, column, or function, and any combination of operators. | ||
|  | ||
| ### `bit_xor` | ||
|  | ||
|  | @@ -71,4 +71,4 @@ bit_xor(expression) | |
|  | ||
| #### Arguments | ||
|  | ||
| - **expression**: Expression to operate on. Can be a constant, column, or function, and any combination of arithmetic operators. | ||
| - **expression**: Integer expression to operate on. Can be a constant, column, or function, and any combination of operators. | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
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.
it might be useful to mention how standard argument differs from just argument?
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.
Good idea, done in 09a4b7b