Skip to content

Phase 4: ConcatField - Refactor to Polars #491

@mattsan-dev

Description

@mattsan-dev

Overview
The Parse step now produces data using Polars LazyFrames, but the ConcatField step still uses the legacy implementation and cannot process this new output. To keep the pipeline consistent and efficient, the ConcatField phase must be updated to use the Polars version. This will keep existing behaviour while modernising the underlying process.

Tech Approach

  • Update digital_land/phase/ConcatField.py so it delegates to the Polars parse implementation.
  • Implement the full ConcatField logic inside digital_land/phase_polars/transform/ConcatField.py.
  • Convert existing ConcatField rules into Polars lazy transformations.
  • Ensure the ConcatField phase accepts the LazyFrame produced by the new normalise step.
  • Keep the same public interface so no downstream code needs changing.

Acceptance Criteria/Tests

  • ConcatField phase accepts the normalise phase LazyFrame without errors.
  • Legacy ConcatField behaviour is reproduced using Polars.
  • Outputs match the legacy ConcatField phase (apart from expected improvements).
  • No Pandas or row‑based Python operations are used.
  • Add test cases
  • Refactored code complies with project formatting and style standards (black/flake8/pep)

Resourcing & Dependencies
Depends on Parse phase, no external teams.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

Status

In Review / QA 🔎

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions