You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/07 01:07:59 UTC

[GitHub] [arrow-datafusion] Jimexist opened a new pull request #284: add param validation for datafusion-cli

Jimexist opened a new pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284


   # Which issue does this PR close?
   
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   
   Closes #283.
   
    # Rationale for this change
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   
   # What changes are included in this PR?
   
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   
   # Are there any user-facing changes?
   
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist edited a comment on pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
Jimexist edited a comment on pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284#issuecomment-834020132






-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist commented on pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
Jimexist commented on pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284#issuecomment-834020132


   need to fix https://github.com/apache/arrow-datafusion/pull/286 fist


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan merged pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
Dandandan merged pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] codecov-commenter commented on pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284#issuecomment-834992757


   # [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/284?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#284](https://codecov.io/gh/apache/arrow-datafusion/pull/284?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8ed8fe7) into [master](https://codecov.io/gh/apache/arrow-datafusion/commit/b8805d4f44d4da8f16069d93ab342dc6f082ca07?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b8805d4) will **decrease** coverage by `0.02%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/arrow-datafusion/pull/284/graphs/tree.svg?width=650&height=150&src=pr&token=JXwWBKD3D9&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/arrow-datafusion/pull/284?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master     #284      +/-   ##
   ==========================================
   - Coverage   76.19%   76.16%   -0.03%     
   ==========================================
     Files         140      140              
     Lines       23595    23603       +8     
   ==========================================
     Hits        17978    17978              
   - Misses       5617     5625       +8     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/arrow-datafusion/pull/284?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [datafusion-cli/src/main.rs](https://codecov.io/gh/apache/arrow-datafusion/pull/284/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGF0YWZ1c2lvbi1jbGkvc3JjL21haW4ucnM=) | `0.00% <0.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/284?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/arrow-datafusion/pull/284?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [b8805d4...8ed8fe7](https://codecov.io/gh/apache/arrow-datafusion/pull/284?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] alamb commented on a change in pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
alamb commented on a change in pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284#discussion_r628539559



##########
File path: datafusion-cli/src/main.rs
##########
@@ -100,6 +102,21 @@ pub async fn main() {
     rl.save_history(".history").ok();
 }
 
+fn is_valid_data_dir(dir: String) -> std::result::Result<(), String> {
+    if Path::new(&dir).is_dir() {
+        Ok(())
+    } else {
+        Err(format!("Invalid data directory “{}”", dir))
+    }
+}
+
+fn is_valid_batch_size(size: String) -> std::result::Result<(), String> {
+    match size.parse::<usize>() {
+        Ok(size) if size > 0 => Ok(()),
+        _ => Err(format!("Invalid batch size “{}”", size)),

Review comment:
       ```suggestion
           _ => Err(format!("Invalid batch size '{}'", size)),
   ```

##########
File path: datafusion-cli/src/main.rs
##########
@@ -100,6 +102,21 @@ pub async fn main() {
     rl.save_history(".history").ok();
 }
 
+fn is_valid_data_dir(dir: String) -> std::result::Result<(), String> {
+    if Path::new(&dir).is_dir() {
+        Ok(())
+    } else {
+        Err(format!("Invalid data directory “{}”", dir))

Review comment:
       ```suggestion
           Err(format!("Invalid data directory '{}'", dir))
   ```
   
   The `'` quote is used in much of the rest of DataFusion so it might be useful to use that here, rather than smart quotes. 




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist commented on pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
Jimexist commented on pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284#issuecomment-833984833


   ```
   ❯ cargo run --release --bin datafusion-cli -- -c 0
       Finished release [optimized] target(s) in 0.20s
        Running `target/release/datafusion-cli -c 0`
   error: Invalid value for '--batch-size <batch-size>': Invalid batch size “0”
   ```


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Jimexist commented on pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
Jimexist commented on pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284#issuecomment-833984765


   ```
   ❯ cargo run --release --bin datafusion-cli -- -p 123
       Finished release [optimized] target(s) in 0.24s
        Running `target/release/datafusion-cli -p 123`
   error: Invalid value for '--data-path <data-path>': Invalid data directory “123”
   ```


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on pull request #284: add param validation for datafusion-cli

Posted by GitBox <gi...@apache.org>.
Dandandan commented on pull request #284:
URL: https://github.com/apache/arrow-datafusion/pull/284#issuecomment-835161016


   Thanks @Jimexist !!


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org