Skip to content

Commit

Permalink
set to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Feb 7, 2024
1 parent 72bac59 commit 2b5d90d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flow/connectors/postgres/qvalue_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,12 +518,13 @@ func parseFieldFromPostgresOID(oid uint32, value interface{}) (qvalue.QValue, er
func numericToRat(numVal *pgtype.Numeric) (*big.Rat, error) {
if numVal.Valid {
if numVal.NaN {
return nil, errors.New("numeric value is NaN")
// set to nil if NaN
return nil, nil
}

switch numVal.InfinityModifier {
case pgtype.NegativeInfinity, pgtype.Infinity:
return nil, errors.New("numeric value is infinity")
return nil, nil
}

rat := new(big.Rat).SetInt(numVal.Int)
Expand Down

0 comments on commit 2b5d90d

Please sign in to comment.