diff --git a/src/value/table.rs b/src/value/table.rs index 2cafaee..727f14d 100644 --- a/src/value/table.rs +++ b/src/value/table.rs @@ -1,4 +1,4 @@ -use crate::{Error, Item, Result, Value, VariableMap}; +use crate::{Error, Result, Value, VariableMap}; use comfy_table::{Cell, Color, ContentArrangement, Table as ComfyTable}; use serde::{Deserialize, Serialize}; use std::{ diff --git a/src/value/value_type.rs b/src/value/value_type.rs index 8363ccd..92d66e8 100644 --- a/src/value/value_type.rs +++ b/src/value/value_type.rs @@ -123,9 +123,17 @@ impl From<&Value> for ValueType { ValueType::Map(value_nodes) } - Value::Table(_table) => ValueType::Table { - column_names: todo!(), - rows: todo!(), + Value::Table(table) => ValueType::Table { + column_names: table + .headers() + .iter() + .map(|column_name| Identifier::new(column_name.clone())) + .collect(), + rows: Box::new(Expression::Value(ValueNode::new( + ValueType::ListExact(Vec::with_capacity(0)), + 0, + 0, + ))), }, Value::Function(function) => ValueType::Function(function.clone()), }