Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-11845

[Rust] Debug implementation of Date32Array panics if array contains negative values

    XMLWordPrintableJSON

Details

    Description

      Attempting to print `Date32Array`s (and probably all Date/Time/Timestamp array types) using Rust's debug print format macro (`println!("{:?}", date_32_array")`) causes a panic, as shown in the minimum reproducible example below:

       

      Invocation:

       

      fn date32_print_panic() {        
          let mut date_32_builder = Date32Builder::new(1);
          date_32_builder.append_value(-50).unwrap();
          let date_32_array = date_32_builder.finish();
          println!("{:?}", date_32_array);
      }
      

       

      Result:

      PrimitiveArray<Date32>
      [
      thread 'demo::tests::date32_print_panic' panicked at 'called `Option::unwrap()` on a `None` value', /home/.../rust/arrow/src/array/array_primitive.rs:226:54
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

      Attachments

        Issue Links

          Activity

            People

              eric.burden Eric Burden
              eric.burden Eric Burden
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5h Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m