From 0f5183eb467bb8e406c9a42ddd80473b1477aa54 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Fri, 15 Mar 2024 15:47:25 +0100 Subject: [PATCH] Re-add deprecation warning --- py-polars/polars/expr/expr.py | 3 +++ py-polars/polars/utils/udfs.py | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/py-polars/polars/expr/expr.py b/py-polars/polars/expr/expr.py index 14a00f81eafa..53f202b52572 100644 --- a/py-polars/polars/expr/expr.py +++ b/py-polars/polars/expr/expr.py @@ -9622,6 +9622,9 @@ def shift_and_fill( """ return self.shift(n, fill_value=fill_value) + @deprecate_function( + "Use `polars.plugins.register_plugin_function` instead.", version="0.20.16" + ) def register_plugin( self, *, diff --git a/py-polars/polars/utils/udfs.py b/py-polars/polars/utils/udfs.py index bc4db0efe087..f7ee74e0eece 100644 --- a/py-polars/polars/utils/udfs.py +++ b/py-polars/polars/utils/udfs.py @@ -3,9 +3,19 @@ import os from typing import Any +from polars._utils.deprecation import deprecate_function + __all__ = ["_get_shared_lib_location"] +@deprecate_function( + "It will be removed in the next breaking release." + " The new `register_plugin_function` function has this functionality built in." + " Use `from polars.plugins import register_plugin_function` to import that function." + " Check the user guide for the currently-recommended way to register a plugin:" + " https://docs.pola.rs/user-guide/expressions/plugins", + version="0.20.16", +) def _get_shared_lib_location(main_file: Any) -> str: """ Get the location of the dynamic library file.