alamb commented on pull request #9749:
URL: https://github.com/apache/arrow/pull/9749#issuecomment-802738494


   So I tried this out locally by taking my commit from 
https://github.com/apache/arrow/pull/9710 
   
   ```
   (arrow_dev) alamb@ip-10-0-0-124:~/Software/arrow2/rust$ git cherry-pick 
fa58e14
   Auto-merging rust/datafusion/src/lib.rs
   [readme_doctest 861031b62] ARROW-11969:  [Rust][DataFusion] Improve Examples 
in documentation
    Date: Mon Mar 15 11:04:32 2021 -0400
    4 files changed, 75 insertions(+), 4 deletions(-)
   ```
   
   And then running the doc tests (which found several bugs!)
   
   ```
   cargo test --doc -p datafusion
   ...
   '
   error[E0277]: the `?` operator can only be used in a function that returns 
`Result` or `Option` (or another type that implements `Try`)
     --> src/lib.rs:296:3
      |
   2  |   fn main() { #[allow(non_snake_case)] fn 
_doctest_main_src_lib_rs_285_0() {
      |  ______________________________________-
   3  | | let mut ctx = ExecutionContext::new();
   4  | |   // create the dataframe
   5  | |   let df = ctx.read_csv("tests/example.csv", CsvReadOptions::new())?;
   ...  |
   13 | |   print_batches(&results)?;
      | |   ^^^^^^^^^^^^^^^^^^^^^^^^ cannot use the `?` operator in a function 
that returns `()`
   14 | | }; _doctest_main_src_lib_rs_285_0() }
      | |_- this function should return `Result` or `Option` to accept `?`
      |
      = help: the trait `Try` is not implemented for `()`
      = note: required by `from_error`
   
   error: aborting due to 18 previous errors
   
   Some errors have detailed explanations: E0277, E0412, E0425, E0433, E0728.
   For more information about an error, try `rustc --explain E0277`.
   Couldn't compile the test.
   
   failures:
       src/lib.rs - readme_example_test (line 271)
       src/lib.rs - readme_example_test (line 285)
       src/lib.rs - readme_example_test (line 301)
   ```
   
   I also verified that running `cargo test --all` ran the tests as well 
   
   I am convinced this will run as part of CI. Thanks for this @returnString . 
Good stuff!
   
   


-- 
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:
us...@infra.apache.org


Reply via email to