Add run ID generator, validator and parser to helpers.python - #245
Closed
Pawansingh3889 wants to merge 7 commits into
Closed
Add run ID generator, validator and parser to helpers.python#245Pawansingh3889 wants to merge 7 commits into
Pawansingh3889 wants to merge 7 commits into
Conversation
- 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
Uv installation
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.
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. |
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.
Description
Closes #244. Adds
generate_run_id,validate_run_idandparse_run_idtordsa_utils.helpers.python.generate_run_id(prefix)produces a human-readable, sortable run ID of the formprefix-yymmdd-hhmm, for examplebb26-260706-1040, the generic version of the ID generator described in the issue.validate_run_idchecks a string is well-formed (including that the date and time describe a real calendar time), andparse_run_iddecodes one back into its prefix and adatetime. 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_entryinpipeline_runlog.py(same# noqa: DTZ005).Type of change
Checklist: