Skip to content

Refactor converters to use the hooks instead of migration; bug fixes #332 - #333

Merged
m-mohr merged 1 commit into
mainfrom
migrate-cleanup
Sep 25, 2026
Merged

m-mohr merged 1 commit into
mainfrom
migrate-cleanup

Conversation

@m-mohr

@m-mohr m-mohr commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Closes #332

Tries to reuse our hook system more than cramming everything into migrate.
Generally refactoring code and small bug fixes.

@m-mohr
m-mohr requested review from ivorbosloper and a balanced review from Copilot September 25, 2026 12:18
@m-mohr
m-mohr added this pull request to stack #334 September 25, 2026 12:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ivorbosloper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, less code is better

@m-mohr
m-mohr merged commit df85c2b into main Sep 25, 2026
8 checks passed
m-mohr added a commit that referenced this pull request Sep 25, 2026
@m-mohr
m-mohr deleted the migrate-cleanup branch September 25, 2026 12:51
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.

Don't overuse the migrate function

3 participants