From c9e272d41e74942d7e84ff5b571a50b33b7fee1e Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 25 Jun 2024 22:57:27 +0200 Subject: [PATCH 1/4] docs(python): Bump docs deps --- py-polars/docs/requirements-docs.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/py-polars/docs/requirements-docs.txt b/py-polars/docs/requirements-docs.txt index ebc05ff66a05..7ec106315b3c 100644 --- a/py-polars/docs/requirements-docs.txt +++ b/py-polars/docs/requirements-docs.txt @@ -6,17 +6,17 @@ pyarrow hypothesis==6.103.0 -sphinx==7.2.4 +sphinx==7.3.7 # Third-party Sphinx extensions -autodocsumm==0.2.11 +autodocsumm==0.2.12 numpydoc==1.7.0 -pydata-sphinx-theme==0.14.1 +pydata-sphinx-theme==0.15.4 sphinx-autosummary-accessors==2023.4.0 sphinx-copybutton==0.5.2 sphinx-design==0.6.0 sphinx-favicon==1.0.1 -sphinx_reredirects==0.1.3 -sphinx-toolbox==3.5.0 +sphinx-reredirects==0.1.4 +sphinx-toolbox==3.6.0 -livereload==2.6.3 +livereload==2.7.0 From 8547173443ce93a47797ab1c18100f195196c5f9 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 25 Jun 2024 23:05:06 +0200 Subject: [PATCH 2/4] Update main docs reqs --- docs/requirements.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 072c07aad41e..6221fdab62d7 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -10,9 +10,9 @@ numba # https://github.com/pola-rs/polars/issues/16998 numpy<2 -mkdocs-material==9.5.2 -mkdocs-macros-plugin==1.0.4 +mkdocs-material==9.5.27 +mkdocs-macros-plugin==1.0.5 mkdocs-redirects==1.2.1 material-plausible-plugin==0.2.0 -markdown-exec[ansi]==1.8.0 -PyGithub==2.3.0 +markdown-exec[ansi]==1.9.3 +pygithub==2.3.0 From daddd4844f07d8e31cdd3c22a9f866a80f2a4e4c Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 25 Jun 2024 23:22:01 +0200 Subject: [PATCH 3/4] Fix doc warning --- docs/src/python/user-guide/expressions/structs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/python/user-guide/expressions/structs.py b/docs/src/python/user-guide/expressions/structs.py index 01e21cca25b5..232ccea9b8c4 100644 --- a/docs/src/python/user-guide/expressions/structs.py +++ b/docs/src/python/user-guide/expressions/structs.py @@ -70,7 +70,7 @@ out = df.select( pl.struct(["keys", "values"]) - .map_elements(lambda x: len(x["keys"]) + x["values"]) + .map_elements(lambda x: len(x["keys"]) + x["values"], return_dtype=pl.Int64) .alias("solution_map_elements"), (pl.col("keys").str.len_bytes() + pl.col("values")).alias("solution_expr"), ) From 74b5d2bd4480bc01bfb91c768261b66babcb1ef2 Mon Sep 17 00:00:00 2001 From: Stijn de Gooijer Date: Tue, 25 Jun 2024 23:40:58 +0200 Subject: [PATCH 4/4] Fix warning --- .../python/user-guide/expressions/user-defined-functions.py | 6 +++++- py-polars/tests/docs/test_user_guide.py | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/src/python/user-guide/expressions/user-defined-functions.py b/docs/src/python/user-guide/expressions/user-defined-functions.py index a436a6d8241e..3962d8ac0b41 100644 --- a/docs/src/python/user-guide/expressions/user-defined-functions.py +++ b/docs/src/python/user-guide/expressions/user-defined-functions.py @@ -1,7 +1,11 @@ # --8<-- [start:setup] +import warnings + import polars as pl +from polars.exceptions import PolarsInefficientMapWarning +warnings.simplefilter("ignore", PolarsInefficientMapWarning) # --8<-- [end:setup] # --8<-- [start:dataframe] @@ -57,7 +61,7 @@ def diff_from_mean(series): # --8<-- [end:np_log] # --8<-- [start:diff_from_mean_numba] -from numba import guvectorize, int64, float64 +from numba import float64, guvectorize, int64 # This will be compiled to machine code, so it will be fast. The Series is diff --git a/py-polars/tests/docs/test_user_guide.py b/py-polars/tests/docs/test_user_guide.py index a513f4b5f0c1..08be6fe9dfbf 100644 --- a/py-polars/tests/docs/test_user_guide.py +++ b/py-polars/tests/docs/test_user_guide.py @@ -32,8 +32,5 @@ def _change_test_dir() -> Iterator[None]: @pytest.mark.docs() @pytest.mark.parametrize("path", snippet_paths) @pytest.mark.usefixtures("_change_test_dir") -@pytest.mark.filterwarnings( - r"ignore:\nExpr\.map_elements:polars.exceptions.PolarsInefficientMapWarning" -) def test_run_python_snippets(path: Path) -> None: runpy.run_path(str(path))