You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "zhengruifeng (via GitHub)" <gi...@apache.org> on 2024/12/25 03:36:59 UTC

[PR] [SPARK-50667][PYTHON][TESTS] Make jinja2 optional in PySpark Tests [spark]

zhengruifeng opened a new pull request, #49288:
URL: https://github.com/apache/spark/pull/49288

   ### What changes were proposed in this pull request?
   Make `jinja2` optional in PySpark Tests
   
   
   ### Why are the changes needed?
   `jinja2` is an optional dependency of `pandas`
   
   https://pypi.org/pypi/pandas/2.2.0/json
   
   ```
   'jinja2>=3.1.2; extra == "output-formatting"'
   ```
   
   
   
   It is not a mandatory requirement of pyspark, so PySpark tests should succeed even it is not installed
   
   
   ### Does this PR introduce _any_ user-facing change?
   no, test-only
   
   
   ### How was this patch tested?
   manually test after uninstalling it
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-50667][PYTHON][TESTS] Make `jinja2` optional in PySpark Tests [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on code in PR #49288:
URL: https://github.com/apache/spark/pull/49288#discussion_r1897513135


##########
python/pyspark/pandas/frame.py:
##########
@@ -13779,11 +13779,15 @@ def _test() -> None:
     import tempfile
     import uuid
     from pyspark.sql import SparkSession
+    from pyspark.testing.utils import have_jinja2
     import pyspark.pandas.frame
 
     os.chdir(os.environ["SPARK_HOME"])
 
     globs = pyspark.pandas.frame.__dict__.copy()
+    if not have_jinja2:
+        del pyspark.pandas.frame.DataFrame.to_latex.__doc__

Review Comment:
   I think we usually just skip doctests (and rely on unittests) in this case



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-50667][PYTHON][TESTS] Make `jinja2` optional in PySpark Tests [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon commented on PR #49288:
URL: https://github.com/apache/spark/pull/49288#issuecomment-2562120494

   Merged to master.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-50667][PYTHON][TESTS] Make `jinja2` optional in PySpark Tests [spark]

Posted by "zhengruifeng (via GitHub)" <gi...@apache.org>.
zhengruifeng commented on code in PR #49288:
URL: https://github.com/apache/spark/pull/49288#discussion_r1897544302


##########
python/pyspark/pandas/frame.py:
##########
@@ -13779,11 +13779,15 @@ def _test() -> None:
     import tempfile
     import uuid
     from pyspark.sql import SparkSession
+    from pyspark.testing.utils import have_jinja2
     import pyspark.pandas.frame
 
     os.chdir(os.environ["SPARK_HOME"])
 
     globs = pyspark.pandas.frame.__dict__.copy()
+    if not have_jinja2:
+        del pyspark.pandas.frame.DataFrame.to_latex.__doc__

Review Comment:
   sounds good



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-50667][PYTHON][TESTS] Make `jinja2` optional in PySpark Tests [spark]

Posted by "HyukjinKwon (via GitHub)" <gi...@apache.org>.
HyukjinKwon closed pull request #49288: [SPARK-50667][PYTHON][TESTS] Make `jinja2` optional in PySpark Tests
URL: https://github.com/apache/spark/pull/49288


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org