diff --git a/haystack/core/component/component.py b/haystack/core/component/component.py index e1dbf2c5f..567faa487 100644 --- a/haystack/core/component/component.py +++ b/haystack/core/component/component.py @@ -71,7 +71,6 @@ method decorated with `@component.input`. This dataclass contains: import inspect import sys -import warnings from collections.abc import Callable from contextlib import contextmanager from contextvars import ContextVar @@ -487,21 +486,12 @@ class _Component: return output_types_decorator - def _component(self, cls, is_greedy: Optional[bool] = None): + def _component(self, cls: Any): """ Decorator validating the structure of the component and registering it in the components registry. """ logger.debug("Registering {component} as a component", component=cls) - if is_greedy is not None: - msg = ( - "The 'is_greedy' argument is deprecated and will be removed in version '2.7.0'. " - "Change the 'Variadic' input of your Component to 'GreedyVariadic' instead." - ) - warnings.warn(msg, DeprecationWarning) - else: - is_greedy = False - # Check for required methods and fail as soon as possible if not hasattr(cls, "run"): raise ComponentError(f"{cls.__name__} must have a 'run()' method. See the docs for more information.") @@ -543,11 +533,11 @@ class _Component: return cls - def __call__(self, cls: Optional[type] = None, is_greedy: Optional[bool] = None): + def __call__(self, cls: Optional[type] = None): # We must wrap the call to the decorator in a function for it to work # correctly with or without parens def wrap(cls): - return self._component(cls, is_greedy=is_greedy) + return self._component(cls) if cls: # Decorator is called without parens diff --git a/releasenotes/notes/remove-deprecated-argument-from-component-decorator-9af6940bc60795d0.yaml b/releasenotes/notes/remove-deprecated-argument-from-component-decorator-9af6940bc60795d0.yaml new file mode 100644 index 000000000..d1b21febb --- /dev/null +++ b/releasenotes/notes/remove-deprecated-argument-from-component-decorator-9af6940bc60795d0.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Remove 'is_greedy' deprecated argument from `@component` decorator. Change the 'Variadic' input of your Component to 'GreedyVariadic' instead.