Skip to content

Commit

Permalink
Fix timezone handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Aug 11, 2024
1 parent 10ca598 commit 6b049ff
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 37 deletions.
47 changes: 19 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ members = [
[workspace.dependencies]
arrow = { version = "52.0.0", default-features = false }
sqlparser = { version = "0.47.0" }
chrono = { version = "0.4.31", default-features = false }
chrono = { version = "0.4.35", default-features = false }
chrono-tz = {version = "0.9.0", features=["case-insensitive", "filter-by-regex"] }
reqwest = { version = "0.11.22", default-features = false }
tokio = { version = "1.36.0" }
pyo3 = { version = "0.21.1" }
Expand Down
4 changes: 3 additions & 1 deletion vegafusion-datafusion-udfs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ description = "Custom DataFusion UDFs used by VegaFusion"
[dependencies]
ordered-float = "3.6.0"
lazy_static = "^1.4.0"
chrono-tz = "0.8.1"
regex = "^1.5.5"

[dependencies.chrono]
workspace = true

[dependencies.chrono-tz]
workspace = true

[dependencies.vegafusion-common]
path = "../vegafusion-common"
version = "1.6.9"
Expand Down
4 changes: 3 additions & 1 deletion vegafusion-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ protobuf-src = [ "vegafusion-core/protobuf-src",]
regex = "^1.5.5"
lazy_static = "^1.4.0"
serde_json = "1.0.91"
chrono-tz = "0.8.1"
num-traits = "0.2.15"
itertools = "0.11.0"
float-cmp = "0.9.0"
Expand Down Expand Up @@ -53,6 +52,9 @@ features = [ "aws",]
[dependencies.chrono]
workspace = true

[dependencies.chrono-tz]
workspace = true

[dependencies.prost]
workspace = true

Expand Down
8 changes: 2 additions & 6 deletions vegafusion-sql/src/dialect/transforms/date_add_tz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ fn maybe_from_utc(ts_expr: SqlExpr, time_zone: &SqlExpr) -> SqlExpr {
args: FunctionArguments::List(FunctionArgumentList {
args: vec![
SqlFunctionArg::Unnamed(SqlFunctionArgExpr::Expr(ts_expr)),
SqlFunctionArg::Unnamed(SqlFunctionArgExpr::Expr(SqlExpr::Value(
SqlValue::SingleQuotedString(time_zone.to_string()),
))),
SqlFunctionArg::Unnamed(SqlFunctionArgExpr::Expr(time_zone.clone())),
],
duplicate_treatment: None,
clauses: vec![],
Expand All @@ -97,9 +95,7 @@ fn maybe_to_utc(ts_expr: SqlExpr, time_zone: &SqlExpr) -> SqlExpr {
args: FunctionArguments::List(FunctionArgumentList {
args: vec![
SqlFunctionArg::Unnamed(SqlFunctionArgExpr::Expr(ts_expr)),
SqlFunctionArg::Unnamed(SqlFunctionArgExpr::Expr(SqlExpr::Value(
SqlValue::SingleQuotedString(time_zone.to_string()),
))),
SqlFunctionArg::Unnamed(SqlFunctionArgExpr::Expr(time_zone.clone())),
],
duplicate_treatment: None,
clauses: vec![],
Expand Down

0 comments on commit 6b049ff

Please sign in to comment.