Skip to content

Commit 37e470e

Browse files
committed
refactor: simplify value type handling
1 parent 72a4cc3 commit 37e470e

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

src/py/mod.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::prelude::*;
22

3-
use crate::base::schema::{BasicValueType, FieldSchema, ValueType};
3+
use crate::base::schema::{FieldSchema, ValueType};
44
use crate::base::spec::VectorSimilarityMetric;
55
use crate::execution::query;
66
use crate::lib_context::{clear_lib_context, get_auth_registry, init_lib_context};
@@ -209,19 +209,8 @@ impl Flow {
209209
let field_name = format!("{}{}", prefix, field.name);
210210

211211
let mut field_type = match &field.value_type.typ {
212-
ValueType::Basic(basic) => match basic {
213-
BasicValueType::Vector(v) => {
214-
let dim = v.dimension.map_or("*".to_string(), |d| d.to_string());
215-
let elem = match *v.element_type {
216-
BasicValueType::Float32 => "Float32",
217-
BasicValueType::Float64 => "Float64",
218-
_ => "Unknown",
219-
};
220-
format!("Vector[{}, {}]", dim, elem)
221-
}
222-
other => format!("{:?}", other),
223-
},
224-
ValueType::Table(t) => format!("{:?}", t.kind),
212+
ValueType::Basic(basic) => format!("{}", basic),
213+
ValueType::Table(t) => format!("{}", t.kind),
225214
ValueType::Struct(_) => "Struct".to_string(),
226215
};
227216

@@ -248,7 +237,7 @@ impl Flow {
248237
process_fields(&s.fields, &format!("{}.", field_name), result);
249238
}
250239
ValueType::Table(t) => {
251-
process_fields(&t.row.fields, &format!("{}.", field_name), result);
240+
process_fields(&t.row.fields, &format!("{}[].", field_name), result);
252241
}
253242
ValueType::Basic(_) => {}
254243
}

0 commit comments

Comments
 (0)