1
0

Fix errors

This commit is contained in:
Jeff 2023-10-22 14:56:41 -04:00
parent b5e659f09f
commit b08a1c5f9a
2 changed files with 12 additions and 4 deletions

View File

@ -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::{

View File

@ -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()),
}