From bc404ae4388cdbdc37ddbcffab7c1a396980fe6e Mon Sep 17 00:00:00 2001 From: Dustin Ray <40841027+drcapybara@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:01:54 -0700 Subject: [PATCH] fix: timezone display (#54) # Rationale for this change Arrow displays inconsistent behavior when instantiating timestamp record columns which include timezones. It is observed that "00:00" is interpreted as a valid timezone string by arrow, but "+00:00" is. # What changes are included in this PR? This PR simply updates the display impl for timezone to match this expectation. # Are these changes tested? yes --- crates/proof-of-sql-parser/src/posql_time/timezone.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/proof-of-sql-parser/src/posql_time/timezone.rs b/crates/proof-of-sql-parser/src/posql_time/timezone.rs index 7f9a21b17..427ac8366 100644 --- a/crates/proof-of-sql-parser/src/posql_time/timezone.rs +++ b/crates/proof-of-sql-parser/src/posql_time/timezone.rs @@ -57,7 +57,7 @@ impl fmt::Display for PoSQLTimeZone { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match *self { PoSQLTimeZone::Utc => { - write!(f, "00:00") + write!(f, "+00:00") } PoSQLTimeZone::FixedOffset(seconds) => { let hours = seconds / 3600; @@ -91,7 +91,7 @@ mod timezone_parsing_tests { #[test] fn test_display_utc() { let timezone = timezone::PoSQLTimeZone::Utc; - assert_eq!(format!("{}", timezone), "00:00"); + assert_eq!(format!("{}", timezone), "+00:00"); } }