Skip to content

Add run ID generator, validator and parser to helpers.python - #245

Closed
Pawansingh3889 wants to merge 7 commits into
ONSdigital:developmentfrom
Pawansingh3889:feature-run-id-generator
Closed

Add run ID generator, validator and parser to helpers.python#245
Pawansingh3889 wants to merge 7 commits into
ONSdigital:developmentfrom
Pawansingh3889:feature-run-id-generator

Conversation

@Pawansingh3889

Copy link
Copy Markdown

Description

Closes #244. Adds generate_run_id, validate_run_id and parse_run_id to rdsa_utils.helpers.python.

generate_run_id(prefix) produces a human-readable, sortable run ID of the form prefix-yymmdd-hhmm, for example bb26-260706-1040, the generic version of the ID generator described in the issue. validate_run_id checks a string is well-formed (including that the date and time describe a real calendar time), and parse_run_id decodes one back into its prefix and a datetime. All three are self-contained with no pipeline-specific dependencies.

Tested with unit tests covering formatting, zero-padding, the default-to-now path, prefix validation, impossible dates and times, round-tripping and parsing. Naive local time is intentional and matches add_runlog_entry in pipeline_runlog.py (same # noqa: DTZ005).

Type of change

  • New feature - non-breaking change

Checklist:

  • I have performed a self-review of my own code.
  • I have commented my code appropriately, focusing on explaining my design decisions (explain why, not how).
  • I have made corresponding changes to the documentation (comments, docstring, etc.. )
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have updated the change log.

humnabaa and others added 7 commits May 8, 2026 12:29
- Add PD901 to ruff ignore list (fixes failing precommit checks)
- Switched PR workflow to use uv sync/uv run pytest
- Switched deploy workflow to use uv publish
- Reverted ruff-suggested code changes in parser.py and test_utils.py
- Restored isort in pre-commit-config.yaml
- Update docs: branch_and_deploy_guide.md and contribution_guide.md for uv
Closes #244. generate_run_id produces human-readable prefix-yymmdd-hhmm run
IDs; validate_run_id and parse_run_id check and decode them. Self-contained,
no pipeline dependencies.
@coatet

coatet commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

This repository is intended to be developed by and for the use of data scientists working within the Office of National Statistics. We don't accept contributions from outside collaborators.

@coatet coatet closed this Jul 16, 2026
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.

3 participants