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

Exclude fields from cache #350

Merged
merged 9 commits into from
Jan 3, 2023
Merged

Exclude fields from cache #350

merged 9 commits into from
Jan 3, 2023

Conversation

JosephMarinier
Copy link
Contributor

@JosephMarinier JosephMarinier commented Dec 23, 2022

Resolve #348

Description:

Exclude desired fields from cache hash by setting an extra parameter exclude_from_cache=True. This allows for more granular control over which config fields (when they are edited) will trigger some modules to recompute. For example, we don't need to recompute the predictions if a pipeline's name changes, so we add exclude_from_cache=True to the name field.

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.

Copy link
Contributor

@gabegma gabegma left a comment

Choose a reason for hiding this comment

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

Quick review, but I need to look into more details the exclude function so I can understand it :)

Thank you for all your help on this!

azimuth/config.py Outdated Show resolved Hide resolved
azimuth/modules/base_classes/module.py Show resolved Hide resolved
tests/test_exclude_from_cache.py Outdated Show resolved Hide resolved
@JosephMarinier JosephMarinier marked this pull request as ready for review January 2, 2023 21:47
Copy link
Contributor

@gabegma gabegma left a comment

Choose a reason for hiding this comment

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

Fantastic work with this PR!! Thank you for taking my relay on this. I could not have brought it this far.

@JosephMarinier
Copy link
Contributor Author

Of course! Thank you! I enjoyed this one and I learn a bunch about pydantic. 👍

@JosephMarinier JosephMarinier merged commit 64de31a into main Jan 3, 2023
@JosephMarinier JosephMarinier deleted the exclude_fields_from_cache branch January 3, 2023 18:28
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.

Refactor which fields from the config should impact caching.
2 participants