Skip to content

test(engine): adding a file through GDAL says the Z or M values it drops, and a clean file nothing (#2671) - #3007

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
ninhhaidang:fix/2671-gdal-zm-notice
Nov 26, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
ninhhaidang:fix/2671-gdal-zm-notice

Conversation

@ninhhaidang

@ninhhaidang ninhhaidang commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Summary

#2671 asked for two things: importing a file through GDAL reports the Z/M values it drops, with a count, and a test both ways. The first landed in #2764: add_gdal now calls zm_notices and notifies dropped.zm. Its tests cover the wording (a_conversion_says_its_parts_z_and_m_once_for_each_kind) and the reload path (portable_projects/reload.rs), but nothing runs the import command itself, so dropping the notify_loss call in add_gdal kept every test green.

This adds gdal_import_says_the_z_and_m_values_it_drops. It adds a GeoJSON sequence (a GDAL-only format) through layer.addData:

  • one of two points has a height: exactly one notice, coded dropped.zm, saying "Z or M coordinates on 1 source feature(s)", so only the features that carry Z are counted;
  • both points flat: no Z/M notice.

The test skips without GDAL (gdal::test_runs()), as the other GDAL tests do; CI's GDAL and DuckDB job runs it.

Test only, no behaviour change, so the surfaces are the ones #2764 reached.

Testing

  • Ran with GDAL 3.13.3: passes. With the notify_loss call in add_gdal removed, it fails (0 notices instead of 1).
  • cargo xtask changed passes with GDAL on PATH.

UI evidence

No visible UI change.

Related issue

Closes #2671

Summary by CodeRabbit

  • Tests
    • Added coverage for GeoJSONL imports with and without Z coordinates, including checks for loss notices and feature details.

…ops, and a clean file nothing (opengeos#2671)

The notice landed in opengeos#2764, tested only through zm_notices' wording and the
reload path. This adds a GeoJSON sequence through layer.addData with real GDAL:
one point with a height gives one dropped.zm notice counting 1 feature, a flat
file none. Without the notify_loss call in add_gdal the test fails.
Copilot AI balanced review requested due to automatic review settings November 26, 2026 04:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

A non-WASM test was added for GDAL imports of GeoJSONL files with and without Z coordinates. It checks for a DroppedZm notice when coordinates are lost and no Z/M notice for the file without Z coordinates.

Changes: GDAL Z/M notice validation

Layer / File(s) Summary
Import notice assertions
crates/engine/src/tests.rs
The test skips when GDAL tests are unavailable. It checks that the import with Z coordinates produces one notice naming one source feature with the DroppedZm loss code, and that the import without Z coordinates produces no “Z or M” notice.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other · Severity of issue fixed: Medium

Possibly related issues

  • Issue 2568: The test checks for a notice when Z/M values are dropped, but does not change how those values are stored.

Suggested reviewers: giswqs, choupeanut, mavrick-f

Merge Risk: Minimal · up to d5883

This PR only adds a test for the GDAL import notice and does not change production behavior. No merge-blocking risk was found.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive Issue #2671 has two coding requirements. (1) Import through GDAL reports dropped Z/M values with a count. (2) Tests cover a 3D file (notice) and a 2D file (no notice). Requirement (1): the head has th… Provide the add_gdal hunk or file read of crates/engine/src/cmd/layer.rs at head (around the notify_loss or zm_notices call) to confirm that requirement (1) holds on the import path. Provide the whole-PR diff of crates/engine/src/tests.rs (…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the change: a test for the GDAL import path that checks the Z/M drop notice. It also states the clean-file case. The title is long (106 characters) and it uses the "test(engine)" prefi…
Description check Passed The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the test and its purpose. Testing lists the GDAL run and a mutation check. UI evid…
Out of Scope Changes check Passed The PR adds one GDAL-gated test (about +36 lines in crates/engine/src/tests.rs, per the raw summary and the commit subject 'test(engine): ... (#2671)'). It directly implements the test requirement of …
Full details: Title check

Explanation

The title names the change: a test for the GDAL import path that checks the Z/M drop notice. It also states the clean-file case. The title is long (106 characters) and it uses the "test(engine)" prefix, which is a fair match for a test-only PR. The title refers to the behaviour under test, not the test code, so it passes with minor length concerns.

Full details: Description check

Explanation

The description follows the template sections: Summary, Testing, UI evidence, and Related issue. The Summary explains the test and its purpose. Testing lists the GDAL run and a mutation check. UI evidence correctly states no visible UI change. Related issue links #2671. The description is complete and clear.

Full details: Out of Scope Changes check

Explanation

The PR adds one GDAL-gated test (about +36 lines in crates/engine/src/tests.rs, per the raw summary and the commit subject 'test(engine): ... (#2671)'). It directly implements the test requirement of #2671. The PR description states no behaviour change. No production code change is reported. The diff itself could not be read, so this verdict relies on the summary and commit subject. Those sources are consistent with each other and with the issue scope.

Full details: Linked Issues check

Explanation

Issue #2671 has two coding requirements. (1) Import through GDAL reports dropped Z/M values with a count. (2) Tests cover a 3D file (notice) and a 2D file (no notice). Requirement (1): the head has the GDAL conversion metadata in crates/data/src/source/gdal.rs (Converted.zm_dropped, zm_unknown, zm_declared). The read of crates/engine/src/cmd/layer.rs was truncated before add_gdal, so the notify_loss or zm_notices call in add_gdal was not seen at head. The PR description attributes it to #2764. Requirement (2): the new test gdal_import_says_the_z_and_m_values_it_drops is described in the PR and the raw summary (GeoJSONL, one 3D point of two, one notice with count 1, dropped.zm code; a flat file with no Z or M notice). The diff could not be read (changed blobs missing from checkout), so the test body was not seen. The GeoJSONSeq format is a GeoJSON variant, which fits the issue's 'GPX/GeoJSON' wording. The PR author's reported runs (pass with GDAL 3.13.3; fail with 0 notices when notify_loss is removed) were not independently verified.

Resolution

Provide the add_gdal hunk or file read of crates/engine/src/cmd/layer.rs at head (around the notify_loss or zm_notices call) to confirm that requirement (1) holds on the import path. Provide the whole-PR diff of crates/engine/src/tests.rs (or the blob) to confirm the test asserts one dropped.zm notice for the 3D case and none for the 2D case.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checked the maps at dawn
“These heights,” it said, “must not be gone!”
A notice marks the dropped Z
And keeps the 2D case notice-free
Then off it hopped through fields of green

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7d605cb7-a44c-4ce4-9221-7c5e6e4cece1
Commits

Reviewing files that changed from the base of the PR and between 336a178 and d588387.

Files selected for processing: 1

  • crates/engine/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

Code review

I read the full diff (one file, +36 lines in crates/engine/src/tests.rs), pr-context/AGENTS.md, the PR metadata, and the prior-review file, which is empty. I could not run the tests here (no shell), so the findings below come from reading the code.

Bugs: None found.

  • The helpers the test uses all exist with the signatures it relies on: source::gdal::test_runs(), Session::new, notice_mark, notices_since, Notice::loss(), and LossCode::DroppedZm.
  • The notice wording matches zm_notices in layer.rs ("Z or M coordinates on N source feature(s)").
  • The lossy case asserts exactly one notice, and the flat case asserts none. Both filters on "Z or M" also catch the "unknown number" wording, so an unexpected notice of either kind fails the test.
  • Confidence: high.

Security: None found. The test writes only to a process-id-named directory under temp_dir().

Performance: None found.

Quality:

  • Inline nit on tests.rs:42: the temp directory is removed only if every assertion passes, so a failing run leaves it behind. The neighbouring GDAL tests do the same, so this is consistent with them. It can wait for the release quality pass.
  • Confidence: high that the behaviour is as described; low impact.

AGENTS.md: No violations found.

  • The test is cfg(not(wasm32)) and skips through gdal::test_runs(), as the guidelines require.
  • It covers both sides (lossy gives the notice, clean gives none).
  • It has no unwrap outside test code, and no assert_eq! with identical sides.
  • The change is test-only, so the command-surface snapshot, the cancellation lists and the schema are unaffected.

Twins checked: Every GDAL vector route in crates/engine/src/cmd/layer.rs (lines 1956, 1977, 2187 and 2203) goes through add_gdal, which is where the notice is raised. The new test covers the path route only, but the other routes share the notice code. Raster add_gdal_path in raster.rs is out of scope for this change.

Already raised in earlier reviews: 0. The prior-review file has no threads, so nothing was left alone.

Change size

Compared with the base branch (merge base 336a178 to PR head d588387), this is the whole PR.

Measure Value
Files changed 1 (added 0, modified 1, removed 0, renamed 0)
Size before 3.57 MB
Size after 3.58 MB
Total size change +1.7 KB
Path Before After Change
crates/engine/src/tests.rs 3.57 MB 3.58 MB +1.7 KB

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Commit d588387 from a fork built, but isn't published until a maintainer adds the preview label (once per commit).

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 26, 2026
Merged via the queue into opengeos:main with commit 7a14126 Nov 26, 2026
28 checks passed
@ninhhaidang
ninhhaidang deleted the fix/2671-gdal-zm-notice branch November 26, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GDAL import drops Z/M values without a notice (reload reports it)

3 participants