shuttle-hq / synth

The Declarative Data Generator
https://www.getsynth.com/
Apache License 2.0
1.37k stars 108 forks source link

Backtrace on series format #413

Closed freimer closed 1 year ago

freimer commented 1 year ago

Describe the bug Receive backtrace on series type format string

To Reproduce Specify a format string of "%Y-%m-%d %H:%M:%S%Z"

  1. Schema (if applicable)
    {
      "type": "series",
      "format": "%Y-%m-%d %H:%M:%S%Z",
      "incrementing": { "start": "2023-01-01 09:00:00", "increment": "1h" }
    }
  2. See error
    
    thread 'main' panicked at 'a Display implementation returned an error unexpectedly: Error', /rustc/c5d82ed7a4ad94a538bb87e5016e7d5ce0bd434b/library/alloc/src/string.rs:2537:14
    stack backtrace:
    0: rust_begin_unwind
             at /rustc/c5d82ed7a4ad94a538bb87e5016e7d5ce0bd434b/library/std/src/panicking.rs:575:5
    1: core::panicking::panic_fmt
             at /rustc/c5d82ed7a4ad94a538bb87e5016e7d5ce0bd434b/library/core/src/panicking.rs:65:14
    2: core::result::unwrap_failed
             at /rustc/c5d82ed7a4ad94a538bb87e5016e7d5ce0bd434b/library/core/src/result.rs:1791:5
    3: <synth_core::graph::series::SeriesFormatter<S> as synth_gen::generator::Generator>::next
    4: <synth_gen::generator::try::TryOnce<G> as synth_gen::generator::Generator>::next
    5: <synth_core::graph::series::SeriesNode as synth_gen::generator::Generator>::next
    6: <synth_core::graph::Graph as synth_gen::generator::Generator>::next
    7: <synth_gen::generator::Concatenate<Left,Right> as synth_gen::generator::Generator>::next
    8: <synth_gen::generator::Concatenate<Left,Right> as synth_gen::generator::Generator>::next
    9: <synth_gen::generator::Chain<G> as synth_gen::generator::Generator>::next
    10: <synth_gen::generator::Brace<BG,G,EG> as synth_gen::generator::Generator>::next
    11: <synth_core::graph::object::ObjectNode as synth_gen::generator::Generator>::next
    12: <synth_core::graph::Graph as synth_gen::generator::Generator>::next
    13: <synth_gen::generator::Repeat<G> as synth_gen::generator::Generator>::next
    14: <synth_gen::generator::Brace<BG,G,EG> as synth_gen::generator::Generator>::next
    15: <synth_gen::generator::try::AndThenTry<TG,F,O> as synth_gen::generator::Generator>::next
    16: <synth_core::graph::Graph as synth_gen::generator::Generator>::next
    17: <synth_gen::generator::Concatenate<Left,Right> as synth_gen::generator::Generator>::next
    18: <synth_gen::generator::Chain<G> as synth_gen::generator::Generator>::next
    19: <synth_gen::generator::Brace<BG,G,EG> as synth_gen::generator::Generator>::next
    20: <synth_core::graph::object::ObjectNode as synth_gen::generator::Generator>::next
    21: <synth_core::graph::Graph as synth_gen::generator::Generator>::next
    22: synth_gen::generator::Generator::complete
    23: synth::sampler::Sampler::sample_seeded
    24: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
    25: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
    26: std::thread::local::LocalKey<T>::with
    27: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
    28: async_io::driver::block_on
    29: async_global_executor::executor::block_on
    30: std::thread::local::LocalKey<T>::with
    31: std::thread::local::LocalKey<T>::with
    32: async_std::task::builder::Builder::blocking
    33: synth::main


**Expected behavior**
That it would not panic and provide an appropriate error message.

**Screenshots**
Not necessary

**Environment (please complete the following information):**
 - OS: Linux
 - Version: Ubuntu 22.04

**Additional context**
Add any other context about the problem here.
freimer commented 1 year ago

It also throws errors, "input contains invalid characters" although not backtraces, simply by removing the dashes between %Y-%m-%d in the format string. Sorry, I have to move on to something else.