Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DatasetSplitManager to reload latest cache. #527

Merged
merged 4 commits into from
Apr 18, 2023
Merged

Conversation

gabegma
Copy link
Contributor

@gabegma gabegma commented Apr 3, 2023

Part of #521

Description:

  • The only problem I see with this refactor, is that modules/functions really need to call mod.get_dataset_split() first (or other dm methods which call it), for the DM to check if the dataset saved in memory is up-to-date. If they call some other methods before, I foresee it could cause an issue, but perhaps not? I haven't seen any issues with the tests not when starting the app though.

Checklist:

You should check all boxes before the PR is ready. If a box does not apply, check it to acknowledge it.

  • ISSUE NUMBER. You linked the issue number (Ex: Resolve #XXX).
  • PRE-COMMIT. You ran pre-commit on all commits, or else, you
    ran pre-commit run --all-files at the end.
  • USER CHANGES. The changes are added to CHANGELOG.md and the documentation, if they impact
    our users.
  • DEV CHANGES.
    • Update the documentation if this PR changes how to develop/launch on the app.
    • Update the README files and our wiki for any big design decisions, if relevant.
    • Add unit tests, docstrings, typing and comments for complex sections.

@gabegma gabegma changed the base branch from ggm/improve-stability-start-up to main April 3, 2023 16:25
@gabegma gabegma changed the base branch from main to ggm/improve-stability-start-up April 3, 2023 16:26
@gabegma gabegma marked this pull request as ready for review April 3, 2023 16:26
@gabegma gabegma changed the base branch from ggm/improve-stability-start-up to main April 3, 2023 16:27
@gabegma gabegma mentioned this pull request Apr 3, 2023
4 tasks
@gabegma gabegma changed the base branch from main to ggm/improve-stability-start-up April 3, 2023 17:11
@gabegma gabegma force-pushed the ggm/refactor-dm branch 2 times, most recently from de74b94 to 3c40dd2 Compare April 3, 2023 18:51
@gabegma gabegma force-pushed the ggm/improve-stability-start-up branch from 825ef39 to bfa4299 Compare April 3, 2023 18:51
@gabegma gabegma self-assigned this Apr 3, 2023
@gabegma gabegma force-pushed the ggm/improve-stability-start-up branch 3 times, most recently from a02a5bb to 28a0a2d Compare April 5, 2023 18:18
@gabegma gabegma force-pushed the ggm/refactor-dm branch 2 times, most recently from 4402ef6 to 5f81471 Compare April 5, 2023 19:12
@gabegma gabegma force-pushed the ggm/improve-stability-start-up branch from 4bba833 to c28c839 Compare April 7, 2023 21:49
@gabegma gabegma force-pushed the ggm/refactor-dm branch 2 times, most recently from 750cca7 to a93803f Compare April 9, 2023 00:45
@gabegma gabegma changed the base branch from ggm/improve-stability-start-up to main April 9, 2023 00:45
@gabegma gabegma force-pushed the ggm/refactor-dm branch 2 times, most recently from 4d33219 to 69b7949 Compare April 13, 2023 20:41
@JosephMarinier JosephMarinier changed the base branch from main to ggm/fix-startup-dependencies April 14, 2023 17:19
@gabegma gabegma force-pushed the ggm/fix-startup-dependencies branch from 0a8ed66 to a9e900f Compare April 17, 2023 19:00
Base automatically changed from ggm/fix-startup-dependencies to main April 17, 2023 20:00
- Define `get_time_from_file_name()` instead of duplicating the `.split("_")[-1][:-6]` logic.
- Use `except StopIteration` on `cache_file = next(...)` instead of passing a default value to `cache_file = next(..., None)` and then checking for `if not cache_file:`.
Co-authored-by: Joseph Marinier <joseph.marinier@servicenow.com>
Copy link
Contributor

@JosephMarinier JosephMarinier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool cool cool! 👍

@gabegma
Copy link
Contributor Author

gabegma commented Apr 18, 2023

Cool cool cool! 👍

Thank you for the quick review today and all of your contributions!!

@gabegma gabegma enabled auto-merge (squash) April 18, 2023 02:57
@gabegma gabegma merged commit 6f98295 into main Apr 18, 2023
@gabegma gabegma deleted the ggm/refactor-dm branch April 18, 2023 03:05
gabegma added a commit that referenced this pull request Apr 19, 2023
* Add pid to logs to help debugging

* Modify DM so it always load the latest cache

* Clean up `load_latest_cache()`

- Define `get_time_from_file_name()` instead of duplicating the `.split("_")[-1][:-6]` logic.
- Use `except StopIteration` on `cache_file = next(...)` instead of passing a default value to `cache_file = next(..., None)` and then checking for `if not cache_file:`.

* Apply suggestions from code review

Co-authored-by: Joseph Marinier <joseph.marinier@servicenow.com>

---------

Co-authored-by: joseph.marinier <joseph.marinier@servicenow.com>
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.

2 participants