Refactor get_start_datetime: split logic, add validate_start_datetime, update usages ..... #498
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.
…, update usages
Pull Request
Description
Refactored the [get_start_datetime] function in (utils.py) to split out logic into smaller, single-responsibility functions.
Added (_parse_n_history_days, _get_yesterday_midnight_utc, and validate_start_datetime) helper functions as also suggested in implementation of the given issue.
As suggested in implementation of this issue
Updated all usages in the codebase to use the new functions appropriately.
i have first done changes in utils.py then for second point i updated usage of function everywhere other in code .
This improves code clarity, maintainability, and makes the logic easier to follow and test.
No external API or behavioral changes — only internal refactor.
No new dependencies were required for this change.
Fixes #485
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Please also list any relevant details for your test configuration
If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
Checklist: