Skip to content

Commit

Permalink
fix: Use microseconds for Unity catalog datetime unit (#21122)
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion authored Feb 7, 2025
1 parent 739aa52 commit 6953b9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/polars-io/src/catalog/unity/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ fn parse_type_text(type_text: &str) -> PolarsResult<DataType> {
"double" => Float64,

"date" => Date,
"timestamp" | "timestamp_ntz" | "timestamp_ltz" => Datetime(TimeUnit::Nanoseconds, None),
"timestamp" | "timestamp_ntz" | "timestamp_ltz" => Datetime(TimeUnit::Microseconds, None),

"string" => String,
"binary" => Binary,
Expand Down Expand Up @@ -290,7 +290,7 @@ fn dtype_to_type_text(dtype: &DataType) -> PolarsResult<PlSmallStr> {
Float64 => S!("double"),

Date => S!("date"),
Datetime(TimeUnit::Nanoseconds, None) => S!("timestamp_ntz"),
Datetime(TimeUnit::Microseconds, None) => S!("timestamp_ntz"),

String => S!("string"),
Binary => S!("binary"),
Expand Down Expand Up @@ -370,7 +370,7 @@ fn dtype_to_type_name(dtype: &DataType) -> PolarsResult<PlSmallStr> {
Float64 => S!("DOUBLE"),

Date => S!("DATE"),
Datetime(TimeUnit::Nanoseconds, None) => S!("TIMESTAMP_NTZ"),
Datetime(TimeUnit::Microseconds, None) => S!("TIMESTAMP_NTZ"),
String => S!("STRING"),
Binary => S!("BINARY"),

Expand Down Expand Up @@ -433,7 +433,7 @@ fn dtype_to_type_json(dtype: &DataType) -> PolarsResult<ColumnTypeJsonType> {
Float64 => S!("double"),

Date => S!("date"),
Datetime(TimeUnit::Nanoseconds, None) => S!("timestamp_ntz"),
Datetime(TimeUnit::Microseconds, None) => S!("timestamp_ntz"),

String => S!("string"),
Binary => S!("binary"),
Expand Down

0 comments on commit 6953b9d

Please sign in to comment.