From 3e7484d5e8046e4b2b7aa64bac7313cf8b65c754 Mon Sep 17 00:00:00 2001 From: Karen Chen <64801825+karenc-bq@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:33:51 -0700 Subject: [PATCH] fix: separate plugin chain cache based on whether a plugin needs to be skipped or not --- aws_advanced_python_wrapper/plugin_service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws_advanced_python_wrapper/plugin_service.py b/aws_advanced_python_wrapper/plugin_service.py index ae15caca..c2a7ec91 100644 --- a/aws_advanced_python_wrapper/plugin_service.py +++ b/aws_advanced_python_wrapper/plugin_service.py @@ -901,10 +901,11 @@ def _execute_with_subscribed_plugins( plugin_func: Callable, target_driver_func: Callable, plugin_to_skip: Optional[Plugin] = None): - pipeline_func: Optional[Callable] = self._function_cache.get(method_name) + cache_key = method_name if plugin_to_skip is None else method_name + plugin_to_skip.__class__.__name__ + pipeline_func: Optional[Callable] = self._function_cache.get(cache_key) if pipeline_func is None: pipeline_func = self._make_pipeline(method_name, plugin_to_skip) - self._function_cache[method_name] = pipeline_func + self._function_cache[cache_key] = pipeline_func return pipeline_func(plugin_func, target_driver_func)