From 70b71da0b04d099dc32d0cf512cca78a87e44abf Mon Sep 17 00:00:00 2001 From: Henry Harbeck <59268910+henryharbeck@users.noreply.github.com> Date: Tue, 16 Apr 2024 06:12:01 +1000 Subject: [PATCH] docs(python): Various deprecation docstring improvements (#15648) Co-authored-by: Henry Harbeck Co-authored-by: Alexander Beedie --- py-polars/polars/__init__.py | 2 +- py-polars/polars/_utils/deprecation.py | 2 +- py-polars/polars/dataframe/frame.py | 2 +- py-polars/polars/expr/datetime.py | 2 +- py-polars/polars/expr/string.py | 2 +- py-polars/polars/io/__init__.py | 2 +- py-polars/polars/lazyframe/frame.py | 2 +- py-polars/polars/series/datetime.py | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/py-polars/polars/__init__.py b/py-polars/polars/__init__.py index 830dc506c0ff..a2eaf7b826eb 100644 --- a/py-polars/polars/__init__.py +++ b/py-polars/polars/__init__.py @@ -297,6 +297,7 @@ "PolarsDataType", # polars.io "read_avro", + "read_clipboard", "read_csv", "read_csv_batched", "read_database", @@ -318,7 +319,6 @@ "scan_ndjson", "scan_parquet", "scan_pyarrow_dataset", - "read_clipboard", # polars.stringcache "StringCache", "disable_string_cache", diff --git a/py-polars/polars/_utils/deprecation.py b/py-polars/polars/_utils/deprecation.py index aca7df3a7850..b74c1a3a7c07 100644 --- a/py-polars/polars/_utils/deprecation.py +++ b/py-polars/polars/_utils/deprecation.py @@ -80,7 +80,7 @@ def deprecate_parameter_as_positional( old_name: str, *, version: str ) -> Callable[[Callable[P, T]], Callable[P, T]]: """ - Decorator to mark a function argument as deprecated due to being made positinoal. + Decorator to mark a function argument as deprecated due to being made positional. Use as follows:: diff --git a/py-polars/polars/dataframe/frame.py b/py-polars/polars/dataframe/frame.py index 293597e09540..814bef99e0a5 100644 --- a/py-polars/polars/dataframe/frame.py +++ b/py-polars/polars/dataframe/frame.py @@ -4796,7 +4796,7 @@ def with_row_count(self, name: str = "row_nr", offset: int = 0) -> Self: """ Add a column at index 0 that counts the rows. - .. deprecated:: + .. deprecated:: 0.20.4 Use :meth:`with_row_index` instead. Note that the default column name has changed from 'row_nr' to 'index'. diff --git a/py-polars/polars/expr/datetime.py b/py-polars/polars/expr/datetime.py index e681780b51cb..09767c386a1e 100644 --- a/py-polars/polars/expr/datetime.py +++ b/py-polars/polars/expr/datetime.py @@ -193,7 +193,7 @@ def truncate( - `False`: use the latest datetime .. deprecated:: 0.19.0 - Use `ambiguous` instead + This is now automatically inferred; you can safely omit this argument. ambiguous Determine how to deal with ambiguous datetimes: diff --git a/py-polars/polars/expr/string.py b/py-polars/polars/expr/string.py index 8de24511c00a..af8acf399f43 100644 --- a/py-polars/polars/expr/string.py +++ b/py-polars/polars/expr/string.py @@ -2586,7 +2586,7 @@ def rjust(self, length: int, fill_char: str = " ") -> Expr: """ return self.pad_start(length, fill_char) - @deprecate_renamed_function("json_decode", version="0.19.12") + @deprecate_renamed_function("json_decode", version="0.19.15") def json_extract( self, dtype: PolarsDataType | None = None, diff --git a/py-polars/polars/io/__init__.py b/py-polars/polars/io/__init__.py index 35f61f1fb596..9d63cc5a3780 100644 --- a/py-polars/polars/io/__init__.py +++ b/py-polars/polars/io/__init__.py @@ -15,6 +15,7 @@ __all__ = [ "read_avro", + "read_clipboard", "read_csv", "read_csv_batched", "read_database", @@ -36,5 +37,4 @@ "scan_ndjson", "scan_parquet", "scan_pyarrow_dataset", - "read_clipboard", ] diff --git a/py-polars/polars/lazyframe/frame.py b/py-polars/polars/lazyframe/frame.py index 9d3e521a807c..4d964e0b5837 100644 --- a/py-polars/polars/lazyframe/frame.py +++ b/py-polars/polars/lazyframe/frame.py @@ -4712,7 +4712,7 @@ def with_row_count(self, name: str = "row_nr", offset: int = 0) -> Self: """ Add a column at index 0 that counts the rows. - .. deprecated:: + .. deprecated:: 0.20.4 Use :meth:`with_row_index` instead. Note that the default column name has changed from 'row_nr' to 'index'. diff --git a/py-polars/polars/series/datetime.py b/py-polars/polars/series/datetime.py index 59b12e7b65c3..a74f8c52b5ce 100644 --- a/py-polars/polars/series/datetime.py +++ b/py-polars/polars/series/datetime.py @@ -1694,7 +1694,7 @@ def truncate( - `False`: use the latest datetime .. deprecated:: 0.19.0 - Use `ambiguous` instead + This is now automatically inferred; you can safely omit this argument. ambiguous Determine how to deal with ambiguous datetimes: