Skip to content

Commit

Permalink
docs(rust): fix un-compilable rust example in user guide. (#11214)
Browse files Browse the repository at this point in the history
  • Loading branch information
reswqa authored Sep 20, 2023
1 parent 6a93d24 commit 6c8b9b7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/src/rust/user-guide/expressions/casting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
col("string").str().strptime(
DataType::Datetime(TimeUnit::Microseconds, None),
StrptimeOptions::default(),
lit("raise"),
),
])
.collect()?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.with_column(
col("ts")
.str()
.strptime(DataType::Date, StrptimeOptions::default()),
.strptime(DataType::Date, StrptimeOptions::default(), lit("raise")),
)
.collect()?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.lazy()
.with_columns([col("Date")
.str()
.strptime(DataType::Date, StrptimeOptions::default())])
.strptime(DataType::Date, StrptimeOptions::default(), lit("raise"))])
.collect()?;
println!("{}", &df);
// --8<-- [end:cast]
Expand Down Expand Up @@ -63,6 +63,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
format: Some("%Y-%m-%dT%H:%M:%S%z".to_string()),
..Default::default()
},
lit("raise"),
)
.dt()
.convert_time_zone("Europe/Brussels".to_string());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.select([col("tz_naive").str().strptime(
DataType::Datetime(TimeUnit::Milliseconds, None),
StrptimeOptions::default(),
lit("raise"),
)])
.with_columns([col("tz_naive")
.dt()
Expand Down

0 comments on commit 6c8b9b7

Please sign in to comment.