-
-
Notifications
You must be signed in to change notification settings - Fork 379
[GSK-2378] Only persist/read cache when explicitly asked #1680
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
[GSK-2378] Only persist/read cache when explicitly asked #1680
Conversation
…el-cache-button-in-the-hub' into feature/gsk-2378-add-a-clear-model-cache-button-in-the-hub
| ) -> websocket.TestSuite: | ||
| log_listener = LogListener() | ||
|
|
||
| loaded_artifacts = dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it initialized here if it's also set in the function with the 'if none' condition ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it' done to share the cache between the global arguments and test ones
Hartorn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some small comment.
Did not test , and just looked quickly
giskard/ml_worker/websocket/utils.py
Outdated
| def parse_function_arguments(client: Optional[GiskardClient], request_arguments: List[websocket.FuncArgument]): | ||
| def _get_or_load(loaded_artifacts: Dict[str, Dict[str, Any]], type: str, uuid: str, load_fn: Callable[[], Any]) -> Any: | ||
| if type not in loaded_artifacts: | ||
| loaded_artifacts[type] = dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be avoided by giving a defaultdict instead of a dict, with dict as default factory
| ) -> websocket.TestSuite: | ||
| log_listener = LogListener() | ||
|
|
||
| loaded_artifacts = dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it' done to share the cache between the global arguments and test ones
giskard/models/cache/cache.py
Outdated
| cache_dir = self._default_cache_dir_prefix.joinpath(self.id) | ||
| if persist_cache: | ||
| if cache_dir is None and self.id: | ||
| cache_dir = self._default_cache_dir_prefix.joinpath(self.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be self._default_cache_dir_prefix / self.id
|

Description
Related Issue
Type of Change
Checklist
CODE_OF_CONDUCT.mddocument.CONTRIBUTING.mdguide.make codestyle.