Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
StringRecords keeps nil values [no test]
Browse files Browse the repository at this point in the history
  • Loading branch information
flarco committed Aug 25, 2023
1 parent 537656a commit 7ec55c6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion iop/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,11 @@ func (data *Dataset) StringRecords(lower ...bool) []map[string]interface{} {
for i, row := range data.Rows {
rec := map[string]interface{}{}
for j, field := range data.GetFields(Lower) {
rec[field] = cast.ToString(row[j])
if row[j] == nil {
rec[field] = nil
} else {
rec[field] = cast.ToString(row[j])
}
}
records[i] = rec
}
Expand Down

0 comments on commit 7ec55c6

Please sign in to comment.