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

Latest version of MarkupSafe doesn't work with Great Expectations #10908

Closed
krishnasism opened this issue Feb 3, 2025 · 3 comments · Fixed by #10941
Closed

Latest version of MarkupSafe doesn't work with Great Expectations #10908

krishnasism opened this issue Feb 3, 2025 · 3 comments · Fixed by #10941
Labels
request-for-help request for help

Comments

@krishnasism
Copy link

krishnasism commented Feb 3, 2025

Describe the bug
When importing great-expectations with the latest version, there's an issue with MarkupSafe. MarkupSafe latest version removes soft_unicode, which gx uses - thus resulting in the error cannot import name 'soft_unicode' from 'markupsafe'

To Reproduce
Install latest version of gx, and import great_expectations

Expected behavior
import should not fail

Environment (please complete the following information):

  • Operating System: Linux
  • Great Expectations Version: 1.3.2
  • Cloud environment: Databricks
  • Python version: 3.10

Comments
Please set a constraint in your pyproject for MarkupSafe>=2 (or whatever works) and MarkupSafe <3

@adeola-ak adeola-ak moved this from To Do to In progress in GX Core Issues Board Feb 12, 2025
@adeola-ak adeola-ak added the request-for-help request for help label Feb 12, 2025
@dctalbot
Copy link
Contributor

Hi, thank you for reporting this issue. I'll share my investigation below:

(.venv) ➜ python --version
Python 3.10.14
(.venv) ➜ pip --version
pip 25.0.1
(.venv) ➜ pip install --no-cache-dir great-expectations==1.3.5
(.venv) ➜ pip freeze | grep MarkupSafe
MarkupSafe==3.0.2
(.venv) ➜ pip install pipdeptree
(.venv) ➜ pipdeptree -r -p markupsafe
MarkupSafe==3.0.2
└── Jinja2==3.1.5 [requires: MarkupSafe>=2.0]
    ├── altair==4.2.2 [requires: Jinja2]
    │   └── great-expectations==1.3.5 [requires: altair>=4.2.1,<5.0.0]
    └── great-expectations==1.3.5 [requires: Jinja2>=2.10]


  • Based on other issues in github, the most likely problem in your environment is an incompatibility with Jinja2 < 3 and MarkupSafe >= 2.1

  • If you have more information to share about your environment, such as the output of pip freeze, that may be helpful to inform our solution

  • Is there something in your environment that is preventing you from upgrading to Jinja2 > 3?

  • It's not clear to me yet whether adding a constraint on MarkupSafe is the right course of action, versus dropping support for Jinja2 < 3

@krishnasism
Copy link
Author

I will try upgrading Jinja and let you know on a weekday. Let me know if you require any other information, I will try to share my pip freeze output as well. I am installing it in a Databricks environment. Will send you more information.

@github-project-automation github-project-automation bot moved this from In progress to Completed in GX Core Issues Board Feb 18, 2025
@dctalbot
Copy link
Contributor

Thanks, that would be greatly appreciated! Our team decided to drop support for Jinja2 v2 regardless. I've marked this issue as resolved since that is likely the source of this error. However, please let us know if your issue persists for any other reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request-for-help request for help
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.

3 participants