From 296023fa437f8a1cd708bed88fa255d771ad3923 Mon Sep 17 00:00:00 2001 From: fderuiter <127706008+fderuiter@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:37:29 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Architect:=20Remove=20u?= =?UTF-8?q?nused=20cache=20argument=20from=20CacheMixin=20and=20ListEndpoi?= =?UTF-8?q?ntMixin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed the unused `cache: Any` argument from `CacheMixin._update_local_cache` and `ListEndpointMixin._process_list_result` to reduce cognitive load and adhere to the "YAGNI" and "KISS" principles, eliminating dead primitive parameters. Design Change: - Removed unused arguments from `_update_local_cache` and `_process_list_result` DRY Gains: - Removed redundant parameter passing in sync/async invocation paths. Solidity: - Maintains existing `sync`/`async` behavior without modifying caching logic. Breaking Changes: - None. These are internal protected methods. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> --- src/imednet/core/endpoint/mixins/caching.py | 1 - src/imednet/core/endpoint/mixins/list.py | 7 +++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/imednet/core/endpoint/mixins/caching.py b/src/imednet/core/endpoint/mixins/caching.py index d8917589..33b0f960 100644 --- a/src/imednet/core/endpoint/mixins/caching.py +++ b/src/imednet/core/endpoint/mixins/caching.py @@ -20,7 +20,6 @@ def _update_local_cache( result: Any, study: str | None, has_filters: bool, - cache: Any, ) -> None: if has_filters or not self._enable_cache: return diff --git a/src/imednet/core/endpoint/mixins/list.py b/src/imednet/core/endpoint/mixins/list.py index 19124807..6a09824b 100644 --- a/src/imednet/core/endpoint/mixins/list.py +++ b/src/imednet/core/endpoint/mixins/list.py @@ -54,9 +54,8 @@ def _process_list_result( result: List[T], study: Optional[str], has_filters: bool, - cache: Any, ) -> List[T]: - self._update_local_cache(result, study, has_filters, cache) + self._update_local_cache(result, study, has_filters) return result def _prepare_list_request( @@ -123,7 +122,7 @@ def _list_sync( ) result = operation.execute_sync(client, paginator_cls) - return self._process_list_result(result, state.study, state.has_filters, state.cache) + return self._process_list_result(result, state.study, state.has_filters) async def _list_async( self, @@ -148,7 +147,7 @@ async def _list_async( ) result = await operation.execute_async(client, paginator_cls) - return self._process_list_result(result, state.study, state.has_filters, state.cache) + return self._process_list_result(result, state.study, state.has_filters) def list( self,