Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Jan 9, 2024
1 parent 6583a3e commit f6e99fe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flow/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ func (r *RecordItems) toMap() (map[string]interface{}, error) {
return nil, errors.New("expected []float64 value")
}

// remove NaN values
// json.Marshal cannot support NaN or INF values
// BigQuery cannot support NULL values in arrays
// Solution: Skip NaN values in float arrays we get
cleanedArr := make([]float64, 0, len(floatArr))
for _, val := range floatArr {
if !math.IsNaN(val) && !math.IsInf(val, 0) {
Expand Down

0 comments on commit f6e99fe

Please sign in to comment.