Skip to content

Fix column mapping for tree polygons and enhance tests for geometry h… - #125

Merged
gibahjoe merged 2 commits into
mainfrom
1226-bug-column-mapping-not-working-for-tree-polygons
Jul 13, 2026
Merged

Fix column mapping for tree polygons and enhance tests for geometry h…#125
gibahjoe merged 2 commits into
mainfrom
1226-bug-column-mapping-not-working-for-tree-polygons

Conversation

@gibahjoe

@gibahjoe gibahjoe commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Fixes column mapping handling for tree polygon check URL workflows. Previously, when column_mapping was supplied, the workflow returned before applying the geom_type mapping. This prevented the tree polygon WKT -> geometry mapping from being added.

This change makes geometry mapping and explicit column mappings additive: geom_type mapping is applied first, then any supplied column_mapping is appended afterwards. It also avoids returning early so the remaining pipeline CSVs continue to download.

Related Tickets & Documents

  • Ticket Link
  • Related Issue #
  • Closes #

QA Instructions, Screenshots, Recordings

Run:

cd request-processor
venv/bin/python -m pytest tests/unit/src/application/core/test_workflow.py -vv
venv/bin/python -m black --check --exclude "digital-land" ./src ./tests
venv/bin/python -m flake8 --exclude="./src/digital-land" ./src ./tests

Confirmed the workflow now keeps WKT -> geometry for tree polygon data while also applying explicit column mappings such as na -> IGNORE.

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests have not been included
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

None.

[optional] Are there any dependencies on other PRs or Work?

None.

Summary by CodeRabbit

  • Bug Fixes
    • Pipeline CSV handling now preserves unmapped columns instead of dropping them.
    • Geometry and column mappings can now be applied together when fetching additional pipeline data, so both sets of changes appear in the resulting CSV.
    • Improved consistency in generated column.csv output for pipeline downloads.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@gibahjoe, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4a2e683c-3296-40b8-9c12-6bcf4d06786a

📥 Commits

Reviewing files that changed from the base of the PR and between bedcdf0 and 93d7837.

📒 Files selected for processing (4)
  • request-processor/src/application/core/workflow.py
  • request-processor/tests/conftest.py
  • request-processor/tests/integration/src/application/core/test_workflow.py
  • request-processor/tests/unit/src/application/core/test_workflow.py

Walkthrough

Updates pipeline CSV fetching so geometry and column mappings can both be applied to column.csv, and makes fetch_pipeline_csvs return accumulated unmapped columns. Unit and integration tests cover the combined mapping behaviour.

Changes

Additive column/geometry mapping

Layer / File(s) Summary
fetch_pipeline_csvs mapping and return value
request-processor/src/application/core/workflow.py
Initialises a not_mapped_columns accumulator, separates geometry mapping for column.csv, and returns the accumulator instead of a fixed empty object.
fetch_add_data_pipeline_csvs additive mapping
request-processor/src/application/core/workflow.py
Updates branch and default download paths so geometry mapping and column mapping can both apply to column.csv.
Combined mapping validation
request-processor/tests/unit/src/application/core/test_workflow.py, request-processor/tests/integration/src/application/core/test_workflow.py
Tests explicit IGNORE and start_date mappings alongside geometry-derived mappings.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is clear and relates to the main change: fixing column mapping for tree polygon geometry handling and updating tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 1226-bug-column-mapping-not-working-for-tree-polygons

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@request-processor/src/application/core/workflow.py`:
- Line 318: The return type of `fetch_pipeline_csvs()` is inconsistent because
`not_mapped_columns` is initialized as a dict instead of a list, so paths that
skip `add_extra_column_mappings()` return `{}`. Update the `not_mapped_columns`
initializer in `workflow.py` to a list and keep the `fetch_pipeline_csvs()`
return path stable; verify the related logic around
`add_extra_column_mappings()` and the final return so `not_mapped_columns` is
always a list.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6121f7e9-9f8e-447e-8ee3-012548dc372e

📥 Commits

Reviewing files that changed from the base of the PR and between fcd60c7 and 8654858.

📒 Files selected for processing (2)
  • request-processor/src/application/core/workflow.py
  • request-processor/tests/unit/src/application/core/test_workflow.py

Comment thread request-processor/src/application/core/workflow.py Outdated
@gibahjoe
gibahjoe force-pushed the 1226-bug-column-mapping-not-working-for-tree-polygons branch from 2c826ca to 16fd1d1 Compare July 9, 2026 23:57
@gibahjoe
gibahjoe merged commit b6fe7ef into main Jul 13, 2026
3 checks passed
@gibahjoe
gibahjoe deleted the 1226-bug-column-mapping-not-working-for-tree-polygons branch July 13, 2026 10:29
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.

[Bug 🐛] Column mapping not working for tree polygons

2 participants