Skip to content

feat: add new lookup-rule for entity numbers - #572

Merged
tombrooks248 merged 1 commit into
mainfrom
feat/add-lookup-rule
Jul 2, 2026
Merged

feat: add new lookup-rule for entity numbers#572
tombrooks248 merged 1 commit into
mainfrom
feat/add-lookup-rule

Conversation

@tombrooks248

@tombrooks248 tombrooks248 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

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

Description

Adds a lookup rule mechanism for assigning entity numbers. Instead of an exact lookup.csv row per reference, a collection can provide an optional lookup-rule.csv defining a rule: apply an offset to an incoming integer reference, and if the result falls within a dataset's entity range (entity-minimum/entity-maximum, inclusive), assign that number as the entity.

Why

Some datasets - e.g. title-boundaries - would require managing an unmanageable number of individual entity records if we relied on exact reference-to-entity lookups. A range-based rule lets a whole dataset's entities be assigned from a single, compact rule instead of millions of lookup rows, which is the prerequisite for adding title boundaries.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

True testing for this will take place once I begin running title-boundary in DEV, but until then this is going to lie dormant for a few days until that is ready.

Testing this PR is safe

This change is inert for existing pipelines — it cannot alter the output of any current collection, because none of them have lookup_rule.csvs in the config repo, in fact currently no collections have lookup_rule.csv in the config repo and this code change will only do anything when I add one to title-boundry.

Ran a pipeline locally with the changes and it all ran fine.

Plus all the existing tests pass.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above. Please refer to the Digital Land Testing Guidance for more information.

  • 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?

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

@tombrooks248
tombrooks248 force-pushed the feat/add-lookup-rule branch from 0407af0 to e5d5168 Compare June 30, 2026 16:18
@tombrooks248
tombrooks248 force-pushed the feat/add-lookup-rule branch from e5d5168 to 993ed6d Compare June 30, 2026 16:35
@tombrooks248
tombrooks248 marked this pull request as ready for review June 30, 2026 16:45

@gibahjoe gibahjoe 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.

LGTM

@tombrooks248
tombrooks248 merged commit 992bfe8 into main Jul 2, 2026
5 checks passed
@tombrooks248
tombrooks248 deleted the feat/add-lookup-rule branch July 2, 2026 08:33
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.

2 participants