ONSdigital / dp-data-pipelines

Pipeline specific python scripts and tooling for automated website data ingress.
MIT License
1 stars 0 forks source link

Refactor matching repetitive functions #155

Closed NickPapONS closed 1 month ago

NickPapONS commented 1 month ago

What

Created a new function, "get_matching_pattern" in matching.py that combines the functionality of the two previously existing functions in this file, as they did essentially the exact same thing but just on different strings. Any usage of the previous functions has been replaced with the new "get_matching_pattern", and the unit tests have been adjusted to remove the tests for the old functions and test the same things on the new function (also avoids test repetition).

How to review

Run the tests, look at the new function and ensure it all looks right.

Who can review

Anyone