Repository navigation
feat(analysis): statistics rounded past 2^53 carry changed.rounded, and the browser download says numbers written as null (#2371) - #3010
Conversation
…nd the browser download says numbers written as null (opengeos#2371)
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| ds.push(Some(Geometry::Point(Coord::new(3.0, 4.0))), vec![Value::Float(1.5)]); | ||
| let id = app.session.map_mut().add_dataset(ds); | ||
| let mark = app.session.notice_mark(); | ||
| let _ = app.run("ui.exportLayer", json!({"layer": id, "format": "geojson"})); |
There was a problem hiding this comment.
The new download test only covers lossy input (a NaN), and it discards the result of app.run(...). Two gaps:
- AGENTS.md ("Test both ways") asks for a clean case: a layer with no non-finite numbers should give no
written as nullnotice, on an accepted download. Nothing here checks that, so a notice that fires on every GeoJSON download would pass. - The refused branch expects an empty notice list, but with
let _ =it also passes if the export itself errored before the download was attempted. Accepted-branch runs shouldunwrap()the result (or assert it isOk), so a failed export can't look like "nothing said".
Suggest adding a third case with Value::Float(1.5) in both rows and expecting vec![], and asserting the run result in the accepted branch.
Category: agents-md
There was a problem hiding this comment.
Fixed in c09050d: a third case downloads finite numbers only and expects no notice, and an accepted download must succeed (unwrap).
| ) }); | ||
| } | ||
| messages.extend(rounded_notice(&rounded, out.fields.get(first_added..).unwrap_or_default())); | ||
| let (said, rounded) = rounded_notice(&rounded, out.fields.get(first_added..).unwrap_or_default()); |
There was a problem hiding this comment.
Nit, left for the release quality pass: after this change rounded holds a Vec<LossMessage> rather than the rounding counts, and said holds the messages. The shadowing works (the right side is evaluated first), but a name like (notices, rounded_losses) would read more clearly. The same pattern repeats at the Summarize Within, Summary Statistics, Pivot Table and Spatial Join call sites.
Category: quality
There was a problem hiding this comment.
Left for the release quality pass: a naming point, no change in behaviour.
Code reviewReviewed the seven changed files against Bugs
Security
Performance
Quality
AGENTS.md
Twins checked
Behaviour change to note
Prior concerns
Change sizeCompared with
|
…a run that must succeed (opengeos#2371)
| ds.push(Some(Geometry::Point(Coord::new(3.0, 4.0))), vec![Value::Float(1.5)]); | ||
| let id = app.session.map_mut().add_dataset(ds); | ||
| let mark = app.session.notice_mark(); | ||
| let run = app.run("ui.exportLayer", json!({"layer": id, "format": "geojson"})); |
There was a problem hiding this comment.
The earlier thread on this test asked for the run result to be checked, and the fix covers only the accepted branch. The refused branch still discards run, so if the export fails before the download is attempted, that case gives the same empty notice list and passes. The refused case only tests that a refused download says nothing, so the export itself should succeed there too. Checking run in both branches would close that gap. I haven't confirmed that app.run returns Ok when the browser refuses the download (self.download returns false and the arm continues), so if it doesn't, the refused case should assert the error instead. The filter on "written as null" also matches on text; filtering on the loss code alone would be more robust.
Category: quality
There was a problem hiding this comment.
Left for the release quality pass: a stricter test for code that works. The refused case still checks that a refused download says nothing.
Code reviewScope: 7 files, +131/−81. The PR routes five statistics tools' rounding notices through Bugs
Security
Performance
Quality
AGENTS.md
Earlier concerns: I left one alone, the Change sizeCompared with
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Summary
Two more notices now carry loss codes, so a strict run (
rustgis-cli run --strict), Python's warnings and MCP'slossessee them by code. No new codes.changed.roundeddropped.valuechanged.rounded's help now names this case.Kept plain on purpose
Testing
dropped.value, a refused one says nothing.UI evidence
No new UI. The rounding notice now shows as a warning, as other coded losses do.
Related issue
Part of #2371.
Summary by CodeRabbit