From cffe4c6039ba6fedfd3a9da6845e1e51c08e83ac Mon Sep 17 00:00:00 2001 From: Tian Gao Date: Thu, 23 Jul 2026 15:14:00 -0700 Subject: [PATCH] Clarify Jinja2 usage --- dev/create-release/spark-rm/Dockerfile | 2 +- dev/spark-test-image/docs/Dockerfile | 2 +- dev/spark-test-image/lint/Dockerfile | 1 - pyproject.toml | 2 +- python/docs/source/getting_started/install.rst | 1 + 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/create-release/spark-rm/Dockerfile b/dev/create-release/spark-rm/Dockerfile index f34f008aa9a63..30cc1d7bdd8d4 100644 --- a/dev/create-release/spark-rm/Dockerfile +++ b/dev/create-release/spark-rm/Dockerfile @@ -57,7 +57,7 @@ RUN python3.11 -m pip install --ignore-installed 'blinker>=1.6.2' && \ # Sphinx and documentation packages # See 'ipython_genutils' in SPARK-38517, 'docutils' in SPARK-39421 RUN python3.11 -m pip install 'sphinx==8.2.3' mkdocs 'pydata_sphinx_theme>=0.13' \ - sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe 'pyzmq<24.0.0' \ + sphinx-copybutton nbsphinx numpydoc markupsafe 'pyzmq<24.0.0' \ ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.23.2' pyarrow pandas \ 'plotly>=4.8' 'docutils' 'mypy==1.19.1' 'pytest==7.1.3' \ 'pytest-mypy-plugins==1.9.3' 'ruff==0.14.8' 'pandas-stubs==1.2.0.53' \ diff --git a/dev/spark-test-image/docs/Dockerfile b/dev/spark-test-image/docs/Dockerfile index fdc364dbc690d..22022dfb77c46 100644 --- a/dev/spark-test-image/docs/Dockerfile +++ b/dev/spark-test-image/docs/Dockerfile @@ -91,7 +91,7 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" # See 'ipython_genutils' in SPARK-38517 # See 'docutils<0.18.0' in SPARK-39421 -RUN python3.12 -m pip install 'sphinx==8.2.3' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe \ +RUN python3.12 -m pip install 'sphinx==8.2.3' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc markupsafe \ ipython ipython_genutils sphinx_plotly_directive 'numpy>=1.23.2' 'pyarrow>=23.0.0' 'pandas==2.3.3' 'plotly>=4.8' 'docutils' \ 'mypy==1.19.1' 'pytest==7.1.3' 'pytest-mypy-plugins==1.9.3' 'ruff==0.14.8' \ 'pandas-stubs==1.2.0.53' 'grpcio==1.76.0' 'grpcio-status==1.76.0' 'protobuf==6.33.5' 'grpc-stubs==1.24.11' 'googleapis-common-protos-stubs==2.2.0' \ diff --git a/dev/spark-test-image/lint/Dockerfile b/dev/spark-test-image/lint/Dockerfile index f3968b0498d3a..ead0e6488c0fb 100644 --- a/dev/spark-test-image/lint/Dockerfile +++ b/dev/spark-test-image/lint/Dockerfile @@ -90,7 +90,6 @@ RUN python3.12 -m pip install \ 'zstandard==0.25.0' \ 'ipython' \ 'ipython_genutils' \ - 'jinja2' \ 'matplotlib' \ 'mypy==1.19.1' \ 'numpy==2.4.1' \ diff --git a/pyproject.toml b/pyproject.toml index 48bd4cc83baaa..01fdcfc63de1a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,6 +107,7 @@ pandas_on_spark_extra = [ "plotly<6.0.0", "matplotlib", "mlflow>=2.3.1", + "jinja2", ] ml = [ @@ -179,7 +180,6 @@ _docs = [ "ipython", "nbsphinx", "numpydoc", - "jinja2", "mkdocs", ] diff --git a/python/docs/source/getting_started/install.rst b/python/docs/source/getting_started/install.rst index d137a19b30c97..558ad51ac98f3 100644 --- a/python/docs/source/getting_started/install.rst +++ b/python/docs/source/getting_started/install.rst @@ -280,6 +280,7 @@ Additional libraries that enhance functionality but are not included in the inst - **mlflow**: Required for ``pyspark.pandas.mlflow``. - **plotly**: Provide plotting for visualization. It is recommended using **plotly** over **matplotlib**. - **matplotlib**: Provide plotting for visualization. The default is **plotly**. +- **jinja2**: Required for ``pyspark.pandas.to_latex``. MLlib DataFrame-based API