MCPcopy Create free account
hub / github.com/Open-Quant/openquant / parse_row

Function parse_row

crates/openquant/src/etf_trick.rs:154–167  ·  view source on GitHub ↗
(record: &StringRecord, path: &Path)

Source from the content-addressed store, hash-verified

152
153 if headers.len() < 2 {
154 return Err(EtfTrickError::TooFewColumns { path: path.display().to_string() });
155 }
156
157 let columns = headers.iter().skip(1).map(ToString::to_string).collect::<Vec<_>>();
158 let mut index = Vec::new();
159 let mut values = Vec::new();
160
161 for rec in rdr.records() {
162 let record = rec.map_err(|e| EtfTrickError::csv("read record", path, e))?;
163 let (idx, row) = parse_row(&record, path)?;
164 index.push(idx);
165 values.push(row);
166 }
167
168 Ok(Self { index, columns, values })
169 }
170

Callers 1

from_csvMethod · 0.85

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected