Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-50667][PYTHON][TESTS] Make jinja2 optional in PySpark Tests #49288

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zhengruifeng
Copy link
Contributor

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

@zhengruifeng zhengruifeng changed the title [SPARK-50667][PYTHON][TESTS] Make jinja2 optional in PySpark Tests [SPARK-50667][PYTHON][TESTS] Make jinja2 optional in PySpark Tests Dec 25, 2024
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__
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants