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

Pin Markupsafe until we are able to upgrade Flask/Jinja #21664

Merged
merged 1 commit into from Feb 18, 2022

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Feb 18, 2022

Markupsafe 2.1.0 breaks with error: import name 'soft_unicode' from 'markupsafe'
This should be removed when either this issue is closed:
pallets/markupsafe#284
or when we will be able to upgrade JINJA to newer version (currently limited due to Flask and
Flask Application Builder)


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@potiuk potiuk force-pushed the pin-markupsafe branch 2 times, most recently from 2539062 to 08d0095 Compare February 18, 2022 09:05
Markupsafe 2.1.0 breaks with error: import name 'soft_unicode' from 'markupsafe'.
This should be removed when either this issue is closed:
pallets/markupsafe#284
or when we will be able to upgrade JINJA to newer version (currently
limited due to Flask and Flask Application Builder)
@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Feb 18, 2022
@github-actions
Copy link

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@potiuk potiuk merged commit 366c66b into apache:main Feb 18, 2022
@potiuk potiuk deleted the pin-markupsafe branch February 18, 2022 10:12
potiuk added a commit that referenced this pull request Feb 18, 2022
Markupsafe 2.1.0 breaks with error: import name 'soft_unicode' from 'markupsafe'.
This should be removed when either this issue is closed:
pallets/markupsafe#284
or when we will be able to upgrade JINJA to newer version (currently
limited due to Flask and Flask Application Builder)

(cherry picked from commit 366c66b)
@potiuk potiuk added this to the Airflow 2.2.4 milestone Feb 18, 2022
@kaxil
Copy link
Member

kaxil commented Feb 18, 2022

Yeah needs to be included in 2.2.4

kaxil added a commit to astronomer/astronomer-providers that referenced this pull request Feb 18, 2022
Markupsafe 2.1.0 breaks with error: import name 'soft_unicode' from 'markupsafe'
This should be removed when either this issue is closed:
pallets/markupsafe#284
or when we will be able to upgrade JINJA to newer version (currently limited due to Flask and
Flask Application Builder)

apache/airflow#21664
@potiuk
Copy link
Member Author

potiuk commented Feb 18, 2022

already did :)

@vinooganesh
Copy link
Contributor

vinooganesh commented Feb 22, 2022

Thanks @potiuk @eladkal and @kaxil for the quick fix here! This actually does block new airflow installs, so really appreciate how quickly you two moved for this.

$ pip install apache-airflow==2.2.3 --ignore-installed 
$ airflow db init 
Traceback (most recent call last):
  File "/usr/local/bin/airflow", line 5, in <module>
    from airflow.__main__ import main
  File "/usr/local/lib/python3.8/dist-packages/airflow/__init__.py", line 34, in <module>
    from airflow import settings
  File "/usr/local/lib/python3.8/dist-packages/airflow/settings.py", line 35, in <module>
    from airflow.configuration import AIRFLOW_HOME, WEBSERVER_CONFIG, conf  # NOQA F401
  File "/usr/local/lib/python3.8/dist-packages/airflow/configuration.py", line 37, in <module>
    from airflow.exceptions import AirflowConfigException
  File "/usr/local/lib/python3.8/dist-packages/airflow/exceptions.py", line 26, in <module>
    from airflow.api_connexion.exceptions import NotFound as ApiConnextionNotFound
  File "/usr/local/lib/python3.8/dist-packages/airflow/api_connexion/exceptions.py", line 21, in <module>
    from airflow._vendor.connexion import FlaskApi, ProblemException, problem
  File "/usr/local/lib/python3.8/dist-packages/airflow/_vendor/connexion/__init__.py", line 5, in <module>
    from .apis import AbstractAPI  # NOQA
  File "/usr/local/lib/python3.8/dist-packages/airflow/_vendor/connexion/apis/__init__.py", line 1, in <module>
    from .abstract import AbstractAPI  # NOQA
  File "/usr/local/lib/python3.8/dist-packages/airflow/_vendor/connexion/apis/abstract.py", line 16, in <module>
    from ..spec import Specification
  File "/usr/local/lib/python3.8/dist-packages/airflow/_vendor/connexion/spec.py", line 5, in <module>
    import jinja2
  File "/usr/local/lib/python3.8/dist-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/usr/local/lib/python3.8/dist-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/usr/local/lib/python3.8/dist-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/usr/local/lib/python3.8/dist-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/lib/python3.8/dist-packages/markupsafe/__init__.py)

@eladkal
Copy link
Contributor

eladkal commented Feb 22, 2022

This actually does block new airflow installs, so really appreciate how quickly you two moved for this.

It shouldn't really have any effect if you install airflow from constraint:
https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html#installation-tools

@vinooganesh
Copy link
Contributor

vinooganesh commented Feb 22, 2022

Oh interesting, I wasn't aware of that method of installation. If other people find this, this seems to work for me:

pip install "apache-airflow[celery]==2.2.3" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.2.3/constraints-3.8.txt" --ignore-installed

Thanks!

@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Apr 14, 2022
@potiuk potiuk restored the pin-markupsafe branch April 26, 2022 20:54
@potiuk potiuk deleted the pin-markupsafe branch July 29, 2022 20:15
OlympuJupiter added a commit to OlympuJupiter/astronomer-providers that referenced this pull request Nov 14, 2022
Markupsafe 2.1.0 breaks with error: import name 'soft_unicode' from 'markupsafe'
This should be removed when either this issue is closed:
pallets/markupsafe#284
or when we will be able to upgrade JINJA to newer version (currently limited due to Flask and
Flask Application Builder)

apache/airflow#21664
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
full tests needed We need to run full set of tests for this PR to merge type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants