Skip to content

Commit

Permalink
Merge pull request #290 from dataforgoodfr/workaround_float_value_out…
Browse files Browse the repository at this point in the history
…ofrange

fix/workaround: Segment Out of range float values are not JSON compli…
  • Loading branch information
rv2931 authored Nov 22, 2024
2 parents 1a14e67 + 90e656a commit 0419557
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/bloom/domain/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Segment(BaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True,
json_encoders = {
Geometry: lambda geometry: mapping(geometry),
# Waiting to manage INF/NaN values, migrating them to None/null
float: lambda val: val if val != 'inf' and val != 'NaN' else None,
},
)
id: Union[int, None] = None
Expand Down

0 comments on commit 0419557

Please sign in to comment.