From 69e1bc81ad557f311d90dc6608488f505bf81070 Mon Sep 17 00:00:00 2001 From: tmontaigu Date: Tue, 24 Oct 2023 21:56:36 +0200 Subject: [PATCH] Fix off by one error in dbase::File dbase::File calculated the position of the record/field assuming the record size by using the header's info which includes the implicit deletion flag size, and dbase::File added the deletion flag size again resulting of bad readings. --- src/datafusion.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/datafusion.rs b/src/datafusion.rs index d862a56..b79d7aa 100644 --- a/src/datafusion.rs +++ b/src/datafusion.rs @@ -436,6 +436,9 @@ mod test { // +-----------------------+ // | Franconia-Springfield | // | Federal Center SW | + // | "Foggy Bottom GWU" | + // | "Farragut West" | + // | "Federal Triangle" | // +-----------------------+ // extract first (and only) RecordBatch from dataframe @@ -448,7 +451,13 @@ mod test { // ensure values match assert_eq!( result[0].column(0).as_ref(), - &StringArray::from(vec!["Franconia-Springfield", "Federal Center SW"]) + &StringArray::from(vec![ + "Franconia-Springfield", + "Federal Center SW", + "Foggy Bottom GWU", + "Farragut West", + "Federal Triangle" + ]) ); Ok(()) }