`get_hyperlink()` doesn't work in combination with `get_lazy_read_sheet_cells()`
When getting cells lazily, hyperlinks don't seem to be read. For example, this works:
let book = umya_spreadsheet::reader::xlsx::read(path.clone())?;
let sheet = book.get_sheet(&0).unwrap();
let cells = sheet.get_collection_by_row(&2);
let links = cells
.iter()
.filter_map(|cell| {
cell.get_hyperlink().map(|hl| hl.get_url().to_string())
})
.collect::<Vec<_>>();
dbg!(links);
But this does not:
let book = umya_spreadsheet::reader::xlsx::lazy_read(path.as_ref())?;
let sheet = book.get_lazy_read_sheet_cells(&0).unwrap();
let cells = sheet.get_collection_by_row(&2);
let links = cells
.iter()
.filter_map(|cell| {
cell.get_hyperlink().map(|hl| hl.get_url().to_string())
})
.collect::<Vec<_>>();
dbg!(links);
@0chroma
When a file is read with lazy_read, most of the information including hyperlinks is not accessible because it has not yet been deserialized.
Please execute read_sheet after lazy_read.
let book = umya_spreadsheet::reader::xlsx::lazy_read(path.clone())?;
book.read_sheet(0); // <- this
let sheet = book.get_sheet(&0).unwrap();
let cells = sheet.get_collection_by_row(&2);
let links = cells
.iter()
.filter_map(|cell| {
cell.get_hyperlink().map(|hl| hl.get_url().to_string())
})
.collect::<Vec<_>>();
dbg!(links);
hmm I feel like it would be better to raise an exception if I'm reading data that hasn't been deserialized yet, I spent a lot of time debugging in order to figure out why I wasn't getting anything back
@0chroma Sorry. I apologize for the extra time and effort. As you indicated, we will modify the system to display error messages.