From 05140b9789304d90fb24b9dc3537529cbef79e35 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Tue, 2 Apr 2024 17:17:39 -0500 Subject: [PATCH] Follow type rename --- Cargo.lock | 2 +- .../ark/src/data_explorer/r_data_explorer.rs | 40 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 265d9452d..5c00452a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1133,7 +1133,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.29", ] [[package]] diff --git a/crates/ark/src/data_explorer/r_data_explorer.rs b/crates/ark/src/data_explorer/r_data_explorer.rs index e758255d5..e2dfc6d9c 100644 --- a/crates/ark/src/data_explorer/r_data_explorer.rs +++ b/crates/ark/src/data_explorer/r_data_explorer.rs @@ -9,7 +9,7 @@ use std::cmp; use amalthea::comm::comm_channel::CommMsg; use amalthea::comm::data_explorer_comm::ColumnSchema; -use amalthea::comm::data_explorer_comm::ColumnSchemaTypeDisplay; +use amalthea::comm::data_explorer_comm::ColumnDisplayType; use amalthea::comm::data_explorer_comm::DataExplorerBackendReply; use amalthea::comm::data_explorer_comm::DataExplorerBackendRequest; use amalthea::comm::data_explorer_comm::GetColumnProfilesParams; @@ -372,61 +372,61 @@ impl RDataExplorer { // This returns the type of an _element_ of the column. In R atomic // vectors do not have a distinct internal type but we pretend that they // do for the purpose of integrating with Positron types. -fn display_type(x: SEXP) -> ColumnSchemaTypeDisplay { +fn display_type(x: SEXP) -> ColumnDisplayType { if r_is_s4(x) { - return ColumnSchemaTypeDisplay::Unknown; + return ColumnDisplayType::Unknown; } if r_is_object(x) { if r_inherits(x, "logical") { - return ColumnSchemaTypeDisplay::Boolean; + return ColumnDisplayType::Boolean; } if r_inherits(x, "integer") { - return ColumnSchemaTypeDisplay::Number; + return ColumnDisplayType::Number; } if r_inherits(x, "double") { - return ColumnSchemaTypeDisplay::Number; + return ColumnDisplayType::Number; } if r_inherits(x, "complex") { - return ColumnSchemaTypeDisplay::Number; + return ColumnDisplayType::Number; } if r_inherits(x, "numeric") { - return ColumnSchemaTypeDisplay::Number; + return ColumnDisplayType::Number; } if r_inherits(x, "character") { - return ColumnSchemaTypeDisplay::String; + return ColumnDisplayType::String; } if r_inherits(x, "factor") { - return ColumnSchemaTypeDisplay::String; + return ColumnDisplayType::String; } if r_inherits(x, "Date") { - return ColumnSchemaTypeDisplay::Date; + return ColumnDisplayType::Date; } if r_inherits(x, "POSIXct") { - return ColumnSchemaTypeDisplay::Datetime; + return ColumnDisplayType::Datetime; } if r_inherits(x, "POSIXlt") { - return ColumnSchemaTypeDisplay::Datetime; + return ColumnDisplayType::Datetime; } // TODO: vctrs's list_of if r_inherits(x, "list") { - return ColumnSchemaTypeDisplay::Unknown; + return ColumnDisplayType::Unknown; } // Catch-all, including for data frame - return ColumnSchemaTypeDisplay::Unknown; + return ColumnDisplayType::Unknown; } match r_typeof(x) { - LGLSXP => return ColumnSchemaTypeDisplay::Boolean, - INTSXP | REALSXP | CPLXSXP => return ColumnSchemaTypeDisplay::Number, - STRSXP => return ColumnSchemaTypeDisplay::String, - VECSXP => return ColumnSchemaTypeDisplay::Unknown, - _ => return ColumnSchemaTypeDisplay::Unknown, + LGLSXP => return ColumnDisplayType::Boolean, + INTSXP | REALSXP | CPLXSXP => return ColumnDisplayType::Number, + STRSXP => return ColumnDisplayType::String, + VECSXP => return ColumnDisplayType::Unknown, + _ => return ColumnDisplayType::Unknown, } }