Skip to content

Commit 531312a

Browse files
committed
Use table.sexp
1 parent aded28d commit 531312a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

crates/ark/src/data_explorer/r_data_explorer.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -563,23 +563,22 @@ impl RDataExplorer {
563563
fn r_get_shape(table: RObject) -> anyhow::Result<DataObjectShape> {
564564
unsafe {
565565
let table = table.clone();
566-
let table_sexp = table.sexp;
567566

568-
let Some(kind) = table_kind(table_sexp) else {
567+
let Some(kind) = table_kind(table.sexp) else {
569568
return Err(anyhow!("Unsupported type for the data viewer"));
570569
};
571570

572571
// `df_n_row()` will materialize duckplyr compact row names, but we are ok
573572
// with that for the data explorer and don't provide a hook to opt out.
574573
let (n_row, n_col, column_names) = match kind {
575574
TableKind::Dataframe => (
576-
harp::df_n_row(table_sexp)?,
577-
harp::df_n_col(table_sexp)?,
578-
ColumnNames::from_data_frame(table_sexp)?,
575+
harp::df_n_row(table.sexp)?,
576+
harp::df_n_col(table.sexp)?,
577+
ColumnNames::from_data_frame(table.sexp)?,
579578
),
580579
TableKind::Matrix => {
581-
let (n_row, n_col) = harp::mat_dim(table_sexp)?;
582-
(n_row, n_col, ColumnNames::from_matrix(table_sexp)?)
580+
let (n_row, n_col) = harp::mat_dim(table.sexp)?;
581+
(n_row, n_col, ColumnNames::from_matrix(table.sexp)?)
583582
},
584583
};
585584

@@ -593,8 +592,8 @@ impl RDataExplorer {
593592
// TODO: handling for nested data frame columns
594593

595594
let col = match kind {
596-
harp::TableKind::Dataframe => VECTOR_ELT(table_sexp, i),
597-
harp::TableKind::Matrix => table_sexp,
595+
harp::TableKind::Dataframe => VECTOR_ELT(table.sexp, i),
596+
harp::TableKind::Matrix => table.sexp,
598597
};
599598

600599
let type_name = WorkspaceVariableDisplayType::from(col, false).display_type;

0 commit comments

Comments
 (0)