Repository navigation
Refactor converters to use the hooks instead of migration; bug fixes #332 - #333
Merged
Merged
Conversation
m-mohr
requested review from
ivorbosloper
and
a balanced review from Copilot
September 25, 2026 12:18
m-mohr
added this pull request to stack #334
September 25, 2026 12:21
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The refactors preserve converter behavior while adding focused regression coverage for the shared hooks.
Review effort: Balanced
Findings: None
What changed in this PR
Refactors converters to use reusable column and migration hooks while fixing dynamic area and HCAT mappings.
Changes:
- Added dynamic
get_columns()support for area, crop, and HCAT processing. - Replaced converter-specific migration logic with shared hooks.
- Added regression coverage and changelog entries.
| File | Description |
|---|---|
CHANGELOG.md |
Documents hooks and fixes. |
fiboa_cli/conversion/fiboa_converter.py |
Resolves dynamic area mappings. |
fiboa_cli/datasets/br_conab.py |
Fixes fallback area assignment. |
fiboa_cli/datasets/commons/de_iacs.py |
Uses dynamic crop columns. |
fiboa_cli/datasets/commons/hcat.py |
Adds reusable HCAT lookup hooks. |
fiboa_cli/datasets/de_by.py |
Reuses HCAT lookup helper. |
fiboa_cli/datasets/de_by_block.py |
Moves code normalization into column migrations. |
fiboa_cli/datasets/de_nds.py |
Dynamically maps edition-specific columns. |
fiboa_cli/datasets/de_sh.py |
Simplifies column renaming. |
fiboa_cli/datasets/de_sl_block.py |
Moves code normalization into column migrations. |
fiboa_cli/datasets/de_th.py |
Moves date parsing into column migrations. |
fiboa_cli/datasets/ec_fr.py |
Delegates missing-area calculation. |
fiboa_cli/datasets/ee.py |
Reuses HCAT lookup helper. |
fiboa_cli/datasets/es.py |
Uses generic composite IDs. |
fiboa_cli/datasets/jecam.py |
Uses shared migrations and area handling. |
fiboa_cli/datasets/lv.py |
Reuses HCAT lookup helper. |
fiboa_cli/datasets/nz.py |
Moves region mapping into column migrations. |
fiboa_cli/datasets/pl.py |
Maps one source crop field to two outputs. |
fiboa_cli/datasets/us_usda_cropland.py |
Dynamically selects yearly crop columns. |
tests/test_area.py |
Tests dynamic area mappings. |
tests/test_converters.py |
Tests dynamic HCAT mappings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
m-mohr
added a commit
that referenced
this pull request
Sep 25, 2026
ivorbosloper
approved these changes
Sep 25, 2026
ivorbosloper
left a comment
Collaborator
There was a problem hiding this comment.
Yes, less code is better
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #332
Tries to reuse our hook system more than cramming everything into migrate.
Generally refactoring code and small bug fixes.