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 and itsdangerous to unblock gates #1238

Merged
merged 6 commits into from
Feb 22, 2022
Merged

Conversation

gaugup
Copy link
Contributor

@gaugup gaugup commented Feb 20, 2022

Description

There seem to be multiple dependency problems with few gate pipelines in responsible-ai-toolbox.

1. The markupsafe package had a breaking change with caused some of the pipelines to fail with the error below:-

File "/usr/share/miniconda/envs/test/bin/jupyter-nbconvert", line 5, in

21 from nbconvert.nbconvertapp import main

22 File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/nbconvert/init.py", line 4, in

23 from .exporters import *

24 File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/nbconvert/exporters/init.py", line 3, in

25 from .html import HTMLExporter

26 File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 16, in

27 import jinja2

28 File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/jinja2/init.py", line 12, in

29 from .environment import Environment

30 File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/jinja2/environment.py", line 25, in

31 from .defaults import BLOCK_END_STRING

32 File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/jinja2/defaults.py", line 3, in

33 from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401

34 File "/usr/share/miniconda/envs/test/lib/python3.7/site-packages/jinja2/filters.py", line 13, in

35 from markupsafe import soft_unicode

36ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/share/miniconda/envs/test/lib/python3.7/site-packages/markupsafe/init.py)

37Existing e2e

tests/test_flask_helper.py:10: in

250 from rai_core_flask import FlaskHelper

251rai_core_flask/init.py:6: in

252 from .flask_helper import FlaskHelper

253rai_core_flask/flask_helper.py:11: in

254 from flask import Flask

255/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/flask/init.py:14: in

256 from jinja2 import escape

257/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/jinja2/init.py:12: in

258 from .environment import Environment

259/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/jinja2/environment.py:25: in

260 from .defaults import BLOCK_END_STRING

261/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/jinja2/defaults.py:3: in

262 from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401

263/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/jinja2/filters.py:13: in

264 from markupsafe import soft_unicode

265E ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/markupsafe/init.py)

There seem to be two failures in different paths. As solution, I am pinning markupsafe in both raiwidgets and rai_core_flask.

  1. The github pages build and CD build failed with an import error from itsdangerous package.

ImportError while importing test module '/home/runner/work/responsible-ai-toolbox/responsible-ai-toolbox/raiwidgets/tests/test_cohort.py'.

27Hint: make sure your test modules/packages have valid Python names.

28Traceback:

29raiwidgets/tests/test_cohort.py:9: in

30 from raiwidgets._cohort import (ClassificationOutcomes, Cohort, CohortFilter,

31/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/raiwidgets/init.py:7: in

32 from .error_analysis_dashboard import ErrorAnalysisDashboard

33/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/raiwidgets/error_analysis_dashboard.py:6: in

34 from flask import jsonify, request

35/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/flask/init.py:21: in

36 from .app import Flask, Request, Response

37/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/flask/app.py:26: in

38 from . import cli, json

39/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/flask/json/init.py:21: in

40 from itsdangerous import json as _json

41E ImportError: cannot import name 'json' from 'itsdangerous' (/opt/hostedtoolcache/Python/3.7.12/x64/lib/python3.7/site-packages/itsdangerous/init.py)

The solution is to pin itsdangerous package to 2.0.1.

Areas changed

npm packages changed:

  • responsibleai/causality
  • responsibleai/core-ui
  • responsibleai/counterfactuals
  • responsibleai/dataset-explorer
  • responsibleai/fairness
  • responsibleai/interpret
  • responsibleai/localization
  • responsibleai/mlchartlib
  • responsibleai/model-assessment

Python packages changed:

  • raiwidgets
  • responsibleai
  • erroranalysis
  • rai_core_flask

Tests

  • No new tests required.
  • New tests for the added feature are part of this PR.
  • I validated the changes manually.

Screenshots (if appropriate):

Documentation:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2022

Codecov Report

Merging #1238 (0d62673) into main (f3b3fe1) will decrease coverage by 9.57%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1238      +/-   ##
==========================================
- Coverage   75.58%   66.01%   -9.58%     
==========================================
  Files          10       91      +81     
  Lines         258     4475    +4217     
==========================================
+ Hits          195     2954    +2759     
- Misses         63     1521    +1458     
Flag Coverage Δ
unittests 66.01% <ø> (-9.58%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
erroranalysis/erroranalysis/report/__init__.py 100.00% <0.00%> (ø)
...iwidgets/raiwidgets/model_performance_dashboard.py 0.00% <0.00%> (ø)
responsibleai/responsibleai/exceptions.py 100.00% <0.00%> (ø)
...ranalysis/erroranalysis/_internal/cohort_filter.py 89.51% <0.00%> (ø)
...iwidgets/raiwidgets/explanation_dashboard_input.py 0.00% <0.00%> (ø)
erroranalysis/erroranalysis/analyzer/__init__.py 100.00% <0.00%> (ø)
responsibleai/responsibleai/managers/__init__.py 100.00% <0.00%> (ø)
...idgets/raiwidgets/responsibleai_dashboard_input.py 0.00% <0.00%> (ø)
...sponsibleai/responsibleai/rai_insights/__init__.py 100.00% <0.00%> (ø)
...tools/error_analysis/dashboard_schemas/__init__.py 100.00% <0.00%> (ø)
... and 71 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f3b3fe1...0d62673. Read the comment docs.

@gaugup gaugup changed the title [WIP] Pin markupsafe to unblock gates Pin markupsafe and itsdangerous to unblock gates Feb 22, 2022
@gaugup gaugup enabled auto-merge (squash) February 22, 2022 19:17
@gaugup gaugup merged commit 4185c9f into main Feb 22, 2022
@gaugup gaugup deleted the gaugup/PinMarkUpSafe branch February 22, 2022 20:55
gaugup added a commit that referenced this pull request Feb 27, 2022
* Pin markupsafe to unblock gates

* Update requirements.txt

* Pin itsdangerous at 2.0.1 to address another dependency failure

* Update requirements.txt

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

Successfully merging this pull request may close these issues.

4 participants