Skip to content

Commit

Permalink
Replace deprecated wtforms HTMLString with markupsafe.MarkUp (#9487)
Browse files Browse the repository at this point in the history
WTForms uses `MarkUp` to escape strings now and removed their internal class HTMLString in Master. Details: wtforms/wtforms#400

That change previously broke Airflow for new users (in 2.3.0). However on users request they added `HTMLString` that just passes all args to `markupsafe.MarkUp` back for temporary Backward compatbility with deprecation warning in 2.3.1. Details: wtforms/wtforms#581

GitOrigin-RevId: 7c587dc486c4f637c681e2e8b61a12ebf99c0f14
  • Loading branch information
kaxil authored and Cloud Composer Team committed Jun 3, 2022
1 parent 370ea43 commit c396334
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 37 deletions.
5 changes: 3 additions & 2 deletions airflow/www/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# under the License.

from flask_appbuilder.widgets import RenderTemplateWidget
from wtforms.widgets import HTMLString, html_params
from markupsafe import Markup
from wtforms.widgets import html_params


class AirflowModelListWidget(RenderTemplateWidget):
Expand All @@ -43,6 +44,6 @@ def __call__(self, field, **kwargs):
field.data = ""
template = self.data_template

return HTMLString(
return Markup(
template % {"text": html_params(type="text", value=field.data, **kwargs)}
)
20 changes: 10 additions & 10 deletions requirements/requirements-python3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ beautifulsoup4==4.7.1
billiard==3.6.3.0
black==19.10b0
blinker==1.4
boto3==1.14.7
boto3==1.14.8
boto==2.49.0
botocore==1.17.7
botocore==1.17.8
bowler==0.8.0
cached-property==1.5.1
cachetools==4.1.0
Expand All @@ -101,7 +101,7 @@ cryptography==2.9.2
curlify==2.2.1
cx-Oracle==7.3.0
dask==2.19.0
datadog==0.36.0
datadog==0.37.0
decorator==4.4.2
defusedxml==0.6.0
dill==0.3.2
Expand All @@ -120,8 +120,8 @@ email-validator==1.1.1
entrypoints==0.3
eventlet==0.25.2
execnet==1.7.1
facebook-business==7.0.2
fastavro==0.23.4
facebook-business==7.0.3
fastavro==0.23.5
filelock==3.0.12
fissix==20.5.1
flake8-colors==0.1.6
Expand Down Expand Up @@ -180,7 +180,7 @@ hmsclient==0.1.1
httplib2==0.18.1
humanize==0.5.1
hvac==0.10.4
identify==1.4.19
identify==1.4.20
idna-ssl==1.1.0
idna==2.9
ijson==2.6.1
Expand All @@ -201,7 +201,7 @@ jira==2.0.0
jmespath==0.10.0
json-merge-patch==0.2
jsondiff==1.1.2
jsonpatch==1.25
jsonpatch==1.26
jsonpickle==1.4.1
jsonpointer==2.0
jsonschema==3.2.0
Expand Down Expand Up @@ -239,7 +239,7 @@ networkx==2.4
nodeenv==1.4.0
nteract-scrapbook==0.4.1
ntlm-auth==1.5.0
numpy==1.18.5
numpy==1.19.0
oauthlib==2.1.0
openapi-spec-validator==0.2.8
oscrypto==1.2.0
Expand Down Expand Up @@ -380,14 +380,14 @@ uritemplate==3.0.1
urllib3==1.25.9
vertica-python==0.10.4
vine==1.3.0
virtualenv==20.0.23
virtualenv==20.0.24
watchtower==0.7.3
wcwidth==0.2.4
websocket-client==0.57.0
wrapt==1.12.1
xmltodict==0.12.0
yamllint==1.23.0
yandexcloud==0.41.0
yandexcloud==0.42.0
yarl==1.4.2
zdesk==2.7.1
zict==2.0.0
Expand Down
20 changes: 10 additions & 10 deletions requirements/requirements-python3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ beautifulsoup4==4.7.1
billiard==3.6.3.0
black==19.10b0
blinker==1.4
boto3==1.14.7
boto3==1.14.8
boto==2.49.0
botocore==1.17.7
botocore==1.17.8
bowler==0.8.0
cached-property==1.5.1
cachetools==4.1.0
Expand All @@ -100,7 +100,7 @@ cryptography==2.9.2
curlify==2.2.1
cx-Oracle==7.3.0
dask==2.19.0
datadog==0.36.0
datadog==0.37.0
decorator==4.4.2
defusedxml==0.6.0
dill==0.3.2
Expand All @@ -119,8 +119,8 @@ email-validator==1.1.1
entrypoints==0.3
eventlet==0.25.2
execnet==1.7.1
facebook-business==7.0.2
fastavro==0.23.4
facebook-business==7.0.3
fastavro==0.23.5
filelock==3.0.12
fissix==20.5.1
flake8-colors==0.1.6
Expand Down Expand Up @@ -179,7 +179,7 @@ hmsclient==0.1.1
httplib2==0.18.1
humanize==0.5.1
hvac==0.10.4
identify==1.4.19
identify==1.4.20
idna==2.9
ijson==2.6.1
imagesize==1.2.0
Expand All @@ -197,7 +197,7 @@ jira==2.0.0
jmespath==0.10.0
json-merge-patch==0.2
jsondiff==1.1.2
jsonpatch==1.25
jsonpatch==1.26
jsonpickle==1.4.1
jsonpointer==2.0
jsonschema==3.2.0
Expand Down Expand Up @@ -235,7 +235,7 @@ networkx==2.4
nodeenv==1.4.0
nteract-scrapbook==0.4.1
ntlm-auth==1.5.0
numpy==1.18.5
numpy==1.19.0
oauthlib==2.1.0
openapi-spec-validator==0.2.8
oscrypto==1.2.0
Expand Down Expand Up @@ -374,14 +374,14 @@ uritemplate==3.0.1
urllib3==1.25.9
vertica-python==0.10.4
vine==1.3.0
virtualenv==20.0.23
virtualenv==20.0.24
watchtower==0.7.3
wcwidth==0.2.4
websocket-client==0.57.0
wrapt==1.12.1
xmltodict==0.12.0
yamllint==1.23.0
yandexcloud==0.41.0
yandexcloud==0.42.0
yarl==1.4.2
zdesk==2.7.1
zict==2.0.0
Expand Down
24 changes: 12 additions & 12 deletions requirements/requirements-python3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ apispec==1.3.3
appdirs==1.4.4
argcomplete==1.11.1
asn1crypto==1.3.0
astroid==2.3.3
astroid==2.4.2
async-generator==1.10
async-timeout==3.0.1
atlasclient==1.0.0
Expand All @@ -72,9 +72,9 @@ beautifulsoup4==4.7.1
billiard==3.6.3.0
black==19.10b0
blinker==1.4
boto3==1.14.7
boto3==1.14.8
boto==2.49.0
botocore==1.17.7
botocore==1.17.8
bowler==0.8.0
cached-property==1.5.1
cachetools==4.1.0
Expand All @@ -100,7 +100,7 @@ cryptography==2.9.2
curlify==2.2.1
cx-Oracle==7.3.0
dask==2.19.0
datadog==0.36.0
datadog==0.37.0
decorator==4.4.2
defusedxml==0.6.0
dill==0.3.2
Expand All @@ -119,8 +119,8 @@ email-validator==1.1.1
entrypoints==0.3
eventlet==0.25.2
execnet==1.7.1
facebook-business==7.0.2
fastavro==0.23.4
facebook-business==7.0.3
fastavro==0.23.5
filelock==3.0.12
fissix==20.5.1
flake8-colors==0.1.6
Expand Down Expand Up @@ -179,7 +179,7 @@ hmsclient==0.1.1
httplib2==0.18.1
humanize==0.5.1
hvac==0.10.4
identify==1.4.19
identify==1.4.20
idna==2.9
ijson==2.6.1
imagesize==1.2.0
Expand All @@ -197,7 +197,7 @@ jira==2.0.0
jmespath==0.10.0
json-merge-patch==0.2
jsondiff==1.1.2
jsonpatch==1.25
jsonpatch==1.26
jsonpickle==1.4.1
jsonpointer==2.0
jsonschema==3.2.0
Expand Down Expand Up @@ -235,7 +235,7 @@ networkx==2.4
nodeenv==1.4.0
nteract-scrapbook==0.4.1
ntlm-auth==1.5.0
numpy==1.18.5
numpy==1.19.0
oauthlib==2.1.0
openapi-spec-validator==0.2.8
oscrypto==1.2.0
Expand Down Expand Up @@ -373,14 +373,14 @@ uritemplate==3.0.1
urllib3==1.25.9
vertica-python==0.10.4
vine==1.3.0
virtualenv==20.0.23
virtualenv==20.0.24
watchtower==0.7.3
wcwidth==0.2.4
websocket-client==0.57.0
wrapt==1.11.2
wrapt==1.12.1
xmltodict==0.12.0
yamllint==1.23.0
yandexcloud==0.41.0
yandexcloud==0.42.0
yarl==1.4.2
zdesk==2.7.1
zict==2.0.0
Expand Down
2 changes: 1 addition & 1 deletion requirements/setup-3.6.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2aefe5ee0325c61727269fc63b030f61 /opt/airflow/setup.py
58b2fa003085a21989e7c2cc68a10461 /opt/airflow/setup.py
2 changes: 1 addition & 1 deletion requirements/setup-3.7.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2aefe5ee0325c61727269fc63b030f61 /opt/airflow/setup.py
58b2fa003085a21989e7c2cc68a10461 /opt/airflow/setup.py
2 changes: 1 addition & 1 deletion requirements/setup-3.8.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2aefe5ee0325c61727269fc63b030f61 /opt/airflow/setup.py
58b2fa003085a21989e7c2cc68a10461 /opt/airflow/setup.py
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ def is_package_excluded(package: str, exclusion_list: List[str]):
'lazy_object_proxy~=1.3',
'lockfile>=0.12.2',
'markdown>=2.5.2, <3.0',
'markupsafe>=1.1.1, <2.0',
'pandas>=0.17.1, <2.0',
'pendulum~=2.0',
'pep562~=1.0;python_version<"3.7"',
Expand Down

0 comments on commit c396334

Please sign in to comment.