{"record":{"id":"582e0463c02bacca","repo":"deepset-ai/haystack","slug":"warning-in-an-upcoming-release-this-method-will","errorCode":null,"errorMessage":"Warning: In an upcoming release, this method will require keyword arguments for all parameters. Please update your code to use keyword arguments to ensure future compatibility. ","messagePattern":"Warning: In an upcoming release, this method will require keyword arguments for all parameters\\. Please update your code to use keyword arguments to ensure future compatibility\\. ","errorType":"console","errorClass":"DeprecationWarning","httpStatus":null,"severity":"warning","filePath":"haystack/core/pipeline/utils.py","lineNumber":196,"sourceCode":"def args_deprecated(func: Callable[..., Any]) -> Callable[..., Any]:\n    \"\"\"\n    Decorator to warn about the use of positional arguments in a function.\n\n    Adapted from https://stackoverflow.com/questions/68432070/\n    :param func:\n    \"\"\"\n\n    def _positional_arg_warning() -> None:\n        \"\"\"\n        Triggers a warning message if positional arguments are used in a function\n        \"\"\"\n        import warnings\n\n        msg = (\n            \"Warning: In an upcoming release, this method will require keyword arguments for all parameters. \"\n            \"Please update your code to use keyword arguments to ensure future compatibility. \"\n        )\n        warnings.warn(msg, DeprecationWarning, stacklevel=2)\n\n    @wraps(func)\n    def wrapper(*args: Any, **kwargs: Any) -> Any:\n        # call the function first, to make sure the signature matches\n        ret_value = func(*args, **kwargs)\n\n        # A Pipeline instance is always the first argument - remove it from the args to check for positional arguments\n        # We check the class name as strings to avoid circular imports\n        if args and isinstance(args, tuple) and args[0].__class__.__name__ in [\"Pipeline\", \"PipelineBase\"]:\n            args = args[1:]\n\n        if args:\n            _positional_arg_warning()\n        return ret_value\n\n    return wrapper\n","sourceCodeStart":178,"sourceCodeEnd":213,"githubUrl":"https://github.com/deepset-ai/haystack/blob/e318778c9bf60a1963e3b5f451359655dd696c30/haystack/core/pipeline/utils.py#L178-L213","documentation":"Haystack is deprecating positional argument calls on Pipeline methods (e.g. Pipeline.run, connect). The args_deprecated decorator (haystack/core/pipeline/utils.py:178) wraps these methods and, after executing, emits this DeprecationWarning when any positional args other than the Pipeline instance itself remain. In a future release such calls will raise TypeError, so callers must switch to keyword arguments now.","triggerScenarios":"Calling a decorated Pipeline method with positional arguments, e.g. pipe.run({'component': {'param': value}}) or pipe.connect('comp_a.output', 'comp_b.input') — anything after the Pipeline self argument triggers the warning.","commonSituations":"Upgrading Haystack and running existing code that passed pipeline inputs or connection endpoints positionally; tutorials or older snippets using pipe.run(inputs) with a dict; large codebases with many legacy Pipeline.run calls that only show the warning when DeprecationWarnings are not filtered.","solutions":["Rewrite every decorated Pipeline method call to use keyword arguments, e.g. pipe.run(data={...}) instead of pipe.run({...})","Check other positional parameters (e.g. include_outputs_from=..., receiver=..., sender=... for connect) and convert them to keywords","Suppress temporarily with warnings.filterwarnings('ignore', category=DeprecationWarning, module='haystack') while migrating, but plan the rewrite before the next major release","Run your test suite with -W error::DeprecationWarning to locate all offending call sites"],"exampleFix":"# before\nresult = pipe.run({\"retriever\": {\"query\": \"hello\"}}, max_retries=1)\npipe.connect(\"retriever.documents\", \"ranker.documents\")\n# after\nresult = pipe.run(data={\"retriever\": {\"query\": \"hello\"}}, max_retries=1)\npipe.connect(sender=\"retriever.documents\", receiver=\"ranker.documents\")","handlingStrategy":"validation","validationCode":"import inspect\n\ndef uses_positional_args(pipe, *args, **kwargs):\n    return bool(args)  # any positional arg beyond the Pipeline instance triggers the warning\n\n# check before calling\nif uses_positional_args(pipe, my_input_dict):\n    # rewrite call to keyword form before invoking\n    pipe.run(data=my_input_dict)","typeGuard":"import inspect\nfrom haystack.core.pipeline import Pipeline\n\ndef is_pipeline_call_with_positionals(func, args: tuple) -> bool:\n    params = inspect.signature(func).parameters\n    names = list(params)\n    # first positional should be the Pipeline instance ('self'); the rest must be keywords\n    return any(isinstance(a, Pipeline) is False or i > 0 for i, a in enumerate(args) if i < len(names))","tryCatchPattern":null,"preventionTips":["Always call Pipeline.run/connect with keyword arguments (data=, sender=, receiver=)","Run CI with python -W error::DeprecationWarning tests to catch positional usage early","Add a lint rule or code-review checklist item banning positional args on Pipeline methods","Subscribe to Haystack release notes to know when the warning becomes a TypeError"],"tags":["deprecation","python","pipeline","keyword-arguments"],"backgroundTag":"positional-args-deprecated","analyzedSha":"e318778c9bf60a1963e3b5f451359655dd696c30","analyzedAt":"2026-08-30T11:45:20.711Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}