Skip to content

Commit

Permalink
More case
Browse files Browse the repository at this point in the history
  • Loading branch information
reswqa committed Sep 20, 2023
1 parent a86bafa commit 194b16e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/rust/user-guide/expressions/casting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
col("string").str().strptime(
DataType::Datetime(TimeUnit::Microseconds, None),
StrptimeOptions::default(),
lit("raise")
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 194b16e

Please sign in to comment.