Repository navigation
feat: enable retire dataset function - #31
Merged
Merged
Conversation
tombrooks248
force-pushed
the
feat/enable-retire-dataset-function
branch
from
October 7, 2026 13:03
569c08b to
d7e1524
Compare
tombrooks248
force-pushed
the
feat/enable-retire-dataset-function
branch
from
October 7, 2026 13:09
d7e1524 to
adfec94
Compare
2 of 8 tasks
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.
What type of PR is this? (check all applicable)
Description
Adds a retire mode to the Postgres loader image:
task/pgload/retire.pyandtask/retire.shcount a dataset's rows inentity,old_entityandentity_subdividedand, unless it is a dry run, delete them in one transaction. The Dockerfile'sENTRYPOINTbecomesCMDso a caller can run./retire.shinstead of./load.shby passing a command, as the collection task already does. No current caller passes a command (the three Airflow DAGs only set environment variables and the task has no S3 triggers), so loading behaves exactly as before.Why
Part 2 of digital-land/digital-land-builder#64. Changing a dataset's
environmentvalue in the specification stops it being built but leaves its entities in Postgres, so its entity pages and API results stay live. Theretire-datasetDAG in airflow-dags will run this mode as itspostgrestask, keeping the code that removes rows next to the code that loads them. OnlyDRY_RUN=falsedeletes anything, matching the collection task's retire mode. Nothing runs this mode until the airflow-dags change is merged.Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Built the image from this branch locally and ran it against a throwaway PostGIS database:
load.sh:docker inspectshowsEntrypoint=null,Cmd=["./load.sh"]../retire.shwithDATASET_NAME=companyandDRY_RUNunset, or mistyped asflase, counted the rows (2entity, 1old_entity, 0entity_subdivided) and changed nothing.DRY_RUN=falseremoved only thecompanyrows; the other datasets' rows were untouched. Running it again removed 0 rows and exited 0.Once merged, dev and staging deploy automatically. Before approving production, run
manual-postgres-loaderin dev on a small dataset to confirm loading still works.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.
have not been included
[optional] Are there any post deployment tasks we need to perform?
[optional] Are there any dependencies on other PRs or Work?