Skip to content

Commit b532c46

Browse files
authored
chore: bump python dependencies (apache#9786)
* chore: bump pyhton dependencies * bump flask-testing * Add note to UPDATING and bump flask-testing in requirements-dev.txt * fix old sqlparse test case that is fixed with sqlparse==0.3.1 * Fix migration and sqlparse set test * downgrade alembic * Downgrade sqlalchemy-utils * pin sqlalchemy-utils due to regression in 0.36.5 * Refine comment in setup.py * make cachelib an explicit requirement
1 parent 34147d9 commit b532c46

File tree

12 files changed

+68
-60
lines changed

12 files changed

+68
-60
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ To do this, you'll need to:
927927
but perfect for testing (stores cache in `/tmp`)
928928

929929
```python
930-
from werkzeug.contrib.cache import FileSystemCache
930+
from cachelib.file import FileSystemCache
931931
RESULTS_BACKEND = FileSystemCache('/tmp/sqllab')
932932
```
933933

UPDATING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ assists people when migrating to a new version.
2323

2424
## Next
2525

26+
* [9786](https://github.com/apache/incubator-superset/pull/9786): with the upgrade of `werkzeug` from version `0.16.0` to `1.0.1`, the `werkzeug.contrib.cache` module has been moved to a standalone package [cachelib](https://pypi.org/project/cachelib/). For example, to import the `RedisCache` class, please use the following import: `from cachelib.redis import RedisCache`.
27+
2628
* [9572](https://github.com/apache/incubator-superset/pull/9572): a change which by defau;t means that the Jinja `current_user_id`, `current_username`, and `url_param` context calls no longer need to be wrapped via `cache_key_wrapper` in order to be included in the cache key. The `cache_key_wrapper` function should only be required for Jinja add-ons.
2729

2830
* [8867](https://github.com/apache/incubator-superset/pull/8867): a change which adds the `tmp_schema_name` column to the `query` table which requires locking the table. Given the `query` table is heavily used performance may be degraded during the migration. Scheduled downtime may be advised.

docker/pythonpath_dev/superset_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import logging
2626
import os
2727

28-
from werkzeug.contrib.cache import FileSystemCache
28+
from cachelib.file import FileSystemCache
2929

3030
logger = logging.getLogger()
3131

docs/installation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ The connection string for PostgreSQL looks like this ::
562562

563563
postgresql+psycopg2://{username}:{password}@{host}:{port}/{database}
564564

565-
Additional may be configured via the ``extra`` field under ``engine_params``.
565+
Additional may be configured via the ``extra`` field under ``engine_params``.
566566
If you would like to enable mutual SSL here is a sample configuration:
567567

568568
.. code-block:: json
@@ -577,7 +577,7 @@ If you would like to enable mutual SSL here is a sample configuration:
577577
}
578578
}
579579
580-
If the key ``sslrootcert`` is present the server's certificate will be verified to be signed by the same Certificate Authority (CA).
580+
If the key ``sslrootcert`` is present the server's certificate will be verified to be signed by the same Certificate Authority (CA).
581581

582582
If you would like to enable mutual SSL here is a sample configuration:
583583

@@ -1056,7 +1056,7 @@ have the same configuration.
10561056
celery beat --app=superset.tasks.celery_app:app
10571057

10581058
To setup a result backend, you need to pass an instance of a derivative
1059-
of ``werkzeug.contrib.cache.BaseCache`` to the ``RESULTS_BACKEND``
1059+
of ``from cachelib.base.BaseCache`` to the ``RESULTS_BACKEND``
10601060
configuration key in your ``superset_config.py``. It's possible to use
10611061
Memcached, Redis, S3 (https://pypi.python.org/pypi/s3werkzeugcache),
10621062
memory or the file system (in a single server-type setup or for testing),
@@ -1072,7 +1072,7 @@ look something like:
10721072
RESULTS_BACKEND = S3Cache(S3_CACHE_BUCKET, S3_CACHE_KEY_PREFIX)
10731073
10741074
# On Redis
1075-
from werkzeug.contrib.cache import RedisCache
1075+
from cachelib.redis import RedisCache
10761076
RESULTS_BACKEND = RedisCache(
10771077
host='localhost', port=6379, key_prefix='superset_results')
10781078

requirements-dev.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,20 @@
1717
black==19.10b0
1818
coverage==4.5.3
1919
flask-cors==3.0.7
20-
flask-testing==0.7.1
20+
flask-testing==0.8.0
2121
ipdb==0.12
2222
isort==4.3.21
2323
mypy==0.770
2424
nose==1.3.7
25-
pip-tools==4.5.1
25+
pip-tools==5.1.2
2626
pre-commit==1.17.0
2727
psycopg2-binary==2.7.5
2828
pycodestyle==2.5.0
29-
pydruid==0.5.7
30-
pyhive==0.6.1
29+
pydruid==0.5.9
30+
pyhive==0.6.2
3131
pylint==1.9.2
32-
redis==3.2.1
33-
requests==2.22.0
32+
redis==3.5.1
33+
requests==2.23.0
3434
statsd==3.3.0
3535
tox==3.11.1
3636
pillow==7.0.0

requirements.txt

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,89 +4,92 @@
44
#
55
# pip-compile --output-file=requirements.txt setup.py
66
#
7-
alembic==1.3.2 # via flask-migrate
7+
alembic==1.4.2 # via flask-migrate
88
amqp==2.5.2 # via kombu
99
apispec[yaml]==1.3.3 # via flask-appbuilder
1010
attrs==19.3.0 # via jsonschema
1111
babel==2.8.0 # via flask-babel
1212
backoff==1.10.0 # via apache-superset (setup.py)
13-
billiard==3.6.1.0 # via celery
14-
bleach==3.1.0 # via apache-superset (setup.py)
15-
celery==4.4.0 # via apache-superset (setup.py)
16-
cffi==1.13.2 # via cryptography
17-
click==7.1.1 # via apache-superset (setup.py), flask, flask-appbuilder
13+
billiard==3.6.3.0 # via celery
14+
bleach==3.1.5 # via apache-superset (setup.py)
15+
brotli==1.0.7 # via flask-compress
16+
cachelib==0.1 # via apache-superset (setup.py)
17+
celery==4.4.2 # via apache-superset (setup.py)
18+
cffi==1.14.0 # via cryptography
19+
click==7.1.2 # via apache-superset (setup.py), flask, flask-appbuilder
1820
colorama==0.4.3 # via apache-superset (setup.py), flask-appbuilder
1921
contextlib2==0.6.0.post1 # via apache-superset (setup.py)
2022
croniter==0.3.31 # via apache-superset (setup.py)
21-
cryptography==2.8 # via apache-superset (setup.py)
23+
cryptography==2.9.2 # via apache-superset (setup.py)
2224
dataclasses==0.6 # via apache-superset (setup.py)
23-
decorator==4.4.1 # via retry
25+
decorator==4.4.2 # via retry
2426
defusedxml==0.6.0 # via python3-openid
2527
dnspython==1.16.0 # via email-validator
26-
email-validator==1.0.5 # via flask-appbuilder
28+
email-validator==1.1.0 # via flask-appbuilder
2729
flask-appbuilder==2.3.4 # via apache-superset (setup.py)
2830
flask-babel==1.0.0 # via flask-appbuilder
2931
flask-caching==1.8.0 # via apache-superset (setup.py)
30-
flask-compress==1.4.0 # via apache-superset (setup.py)
32+
flask-compress==1.5.0 # via apache-superset (setup.py)
3133
flask-jwt-extended==3.24.1 # via flask-appbuilder
3234
flask-login==0.4.1 # via flask-appbuilder
33-
flask-migrate==2.5.2 # via apache-superset (setup.py)
35+
flask-migrate==2.5.3 # via apache-superset (setup.py)
3436
flask-openid==1.2.5 # via flask-appbuilder
3537
flask-sqlalchemy==2.4.1 # via flask-appbuilder, flask-migrate
3638
flask-talisman==0.7.0 # via apache-superset (setup.py)
37-
flask-wtf==0.14.2 # via apache-superset (setup.py), flask-appbuilder
38-
flask==1.1.1 # via apache-superset (setup.py), flask-appbuilder, flask-babel, flask-caching, flask-compress, flask-jwt-extended, flask-login, flask-migrate, flask-openid, flask-sqlalchemy, flask-wtf
39+
flask-wtf==0.14.3 # via apache-superset (setup.py), flask-appbuilder
40+
flask==1.1.2 # via apache-superset (setup.py), flask-appbuilder, flask-babel, flask-caching, flask-compress, flask-jwt-extended, flask-login, flask-migrate, flask-openid, flask-sqlalchemy, flask-wtf
3941
geographiclib==1.50 # via geopy
40-
geopy==1.21.0 # via apache-superset (setup.py)
42+
geopy==1.22.0 # via apache-superset (setup.py)
4143
gunicorn==20.0.4 # via apache-superset (setup.py)
42-
humanize==0.5.1 # via apache-superset (setup.py)
44+
humanize==2.4.0 # via apache-superset (setup.py)
4345
idna==2.9 # via email-validator
44-
importlib-metadata==1.4.0 # via jsonschema, kombu
46+
importlib-metadata==1.6.0 # via jsonschema, kombu, markdown
4547
isodate==0.6.0 # via apache-superset (setup.py)
46-
itsdangerous==1.1.0 # via flask
47-
jinja2==2.10.3 # via flask, flask-babel
48+
itsdangerous==1.1.0 # via flask, flask-wtf
49+
jinja2==2.11.2 # via flask, flask-babel
4850
jsonschema==3.2.0 # via flask-appbuilder
49-
kombu==4.6.7 # via celery
50-
mako==1.1.1 # via alembic
51-
markdown==3.1.1 # via apache-superset (setup.py)
52-
markupsafe==1.1.1 # via jinja2, mako
51+
kombu==4.6.8 # via celery
52+
mako==1.1.2 # via alembic
53+
markdown==3.2.2 # via apache-superset (setup.py)
54+
markupsafe==1.1.1 # via jinja2, mako, wtforms
5355
marshmallow-enum==1.5.1 # via flask-appbuilder
54-
marshmallow-sqlalchemy==0.21.0 # via flask-appbuilder
55-
marshmallow==2.19.5 # via flask-appbuilder, marshmallow-enum, marshmallow-sqlalchemy
56-
more-itertools==8.1.0 # via zipp
57-
msgpack==0.6.2 # via apache-superset (setup.py)
58-
numpy==1.18.1 # via pandas, pyarrow
56+
marshmallow-sqlalchemy==0.23.0 # via flask-appbuilder
57+
marshmallow==2.21.0 # via flask-appbuilder, marshmallow-enum, marshmallow-sqlalchemy
58+
msgpack==1.0.0 # via apache-superset (setup.py)
59+
numpy==1.18.4 # via pandas, pyarrow
60+
packaging==20.3 # via bleach
5961
pandas==1.0.3 # via apache-superset (setup.py)
6062
parsedatetime==2.5 # via apache-superset (setup.py)
6163
pathlib2==2.3.5 # via apache-superset (setup.py)
6264
polyline==1.4.0 # via apache-superset (setup.py)
6365
prison==0.1.3 # via flask-appbuilder
6466
py==1.8.1 # via retry
6567
pyarrow==0.17.0 # via apache-superset (setup.py)
66-
pycparser==2.19 # via cffi
68+
pycparser==2.20 # via cffi
6769
pyjwt==1.7.1 # via flask-appbuilder, flask-jwt-extended
68-
pyrsistent==0.15.7 # via jsonschema
70+
pyparsing==2.4.7 # via packaging
71+
pyrsistent==0.16.0 # via jsonschema
6972
python-dateutil==2.8.1 # via alembic, apache-superset (setup.py), croniter, flask-appbuilder, pandas
70-
python-dotenv==0.10.5 # via apache-superset (setup.py)
73+
python-dotenv==0.13.0 # via apache-superset (setup.py)
7174
python-editor==1.0.4 # via alembic
7275
python-geohash==0.8.5 # via apache-superset (setup.py)
7376
python3-openid==3.1.0 # via flask-openid
74-
pytz==2019.3 # via babel, celery, flask-babel, pandas
75-
pyyaml==5.3 # via apache-superset (setup.py), apispec
77+
pytz==2020.1 # via babel, celery, flask-babel, pandas
78+
pyyaml==5.3.1 # via apache-superset (setup.py), apispec
7679
retry==0.9.2 # via apache-superset (setup.py)
7780
selenium==3.141.0 # via apache-superset (setup.py)
7881
simplejson==3.17.0 # via apache-superset (setup.py)
79-
six==1.14.0 # via bleach, cryptography, flask-jwt-extended, flask-talisman, isodate, jsonschema, pathlib2, polyline, prison, pyrsistent, python-dateutil, sqlalchemy-utils, wtforms-json
80-
sqlalchemy-utils==0.36.1 # via apache-superset (setup.py), flask-appbuilder
82+
six==1.14.0 # via bleach, cryptography, flask-jwt-extended, flask-talisman, isodate, jsonschema, packaging, pathlib2, polyline, prison, pyrsistent, python-dateutil, sqlalchemy-utils, wtforms-json
83+
sqlalchemy-utils==0.36.4 # via apache-superset (setup.py), flask-appbuilder
8184
sqlalchemy==1.3.16 # via alembic, apache-superset (setup.py), flask-sqlalchemy, marshmallow-sqlalchemy, sqlalchemy-utils
82-
sqlparse==0.3.0 # via apache-superset (setup.py)
83-
urllib3==1.25.8 # via selenium
85+
sqlparse==0.3.1 # via apache-superset (setup.py)
86+
urllib3==1.25.9 # via selenium
8487
vine==1.3.0 # via amqp, celery
8588
webencodings==0.5.1 # via bleach
86-
werkzeug==0.16.0 # via flask, flask-jwt-extended
89+
werkzeug==1.0.1 # via flask, flask-jwt-extended
8790
wtforms-json==0.3.3 # via apache-superset (setup.py)
88-
wtforms==2.2.1 # via flask-wtf, wtforms-json
89-
zipp==2.0.0 # via importlib-metadata
91+
wtforms==2.3.1 # via flask-wtf, wtforms-json
92+
zipp==3.1.0 # via importlib-metadata
9093

9194
# The following packages are considered to be unsafe in a requirements file:
9295
# setuptools

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ combine_as_imports = true
4545
include_trailing_comma = true
4646
line_length = 88
4747
known_first_party = superset
48-
known_third_party =alembic,apispec,backoff,bleach,celery,click,colorama,contextlib2,croniter,cryptography,dataclasses,dateutil,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,geohash,geopy,humanize,isodate,jinja2,markdown,markupsafe,marshmallow,msgpack,numpy,pandas,parsedatetime,pathlib2,polyline,prison,pyarrow,pyhive,pytz,retry,selenium,setuptools,simplejson,sphinx_rtd_theme,sqlalchemy,sqlalchemy_utils,sqlparse,werkzeug,wtforms,wtforms_json,yaml
48+
known_third_party =alembic,apispec,backoff,bleach,cachelib,celery,click,colorama,contextlib2,croniter,cryptography,dataclasses,dateutil,flask,flask_appbuilder,flask_babel,flask_caching,flask_compress,flask_login,flask_migrate,flask_sqlalchemy,flask_talisman,flask_testing,flask_wtf,geohash,geopy,humanize,isodate,jinja2,markdown,markupsafe,marshmallow,msgpack,numpy,pandas,parsedatetime,pathlib2,polyline,prison,pyarrow,pyhive,pytz,retry,selenium,setuptools,simplejson,sphinx_rtd_theme,sqlalchemy,sqlalchemy_utils,sqlparse,werkzeug,wtforms,wtforms_json,yaml
4949
multi_line_output = 3
5050
order_by_type = false
5151

setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def get_git_sha():
6969
install_requires=[
7070
"backoff>=1.8.0",
7171
"bleach>=3.0.2, <4.0.0",
72+
"cachelib>=0.1,<0.2",
7273
"celery>=4.3.0, <5.0.0, !=4.4.1",
7374
"click<8",
7475
"colorama",
@@ -88,7 +89,7 @@ def get_git_sha():
8889
"humanize",
8990
"isodate",
9091
"markdown>=3.0",
91-
"msgpack>=0.6.1, <0.7.0",
92+
"msgpack>=1.0.0, <1.1",
9293
"pandas>=1.0.3, <1.1",
9394
"parsedatetime",
9495
"pathlib2",
@@ -102,7 +103,10 @@ def get_git_sha():
102103
"selenium>=3.141.0",
103104
"simplejson>=3.15.0",
104105
"sqlalchemy>=1.3.16, <2.0",
105-
"sqlalchemy-utils>=0.33.2",
106+
# Breaking change in sqlalchemy-utils==0.36.6, upgrading will probably
107+
# require a migration on EncryptedType columns. For more information, see
108+
# https://github.com/kvesteri/sqlalchemy-utils/issues/444
109+
"sqlalchemy-utils>=0.33.2,<0.36.5",
106110
"sqlparse>=0.3.0, <0.4",
107111
"wtforms-json",
108112
],
@@ -130,5 +134,5 @@ def get_git_sha():
130134
"Programming Language :: Python :: 3.6",
131135
"Programming Language :: Python :: 3.7",
132136
],
133-
tests_require=["flask-testing==0.7.1"],
137+
tests_require=["flask-testing==0.8.0"],
134138
)

superset/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
568568
Callable[["Database", "models.User", str, str], str]
569569
] = None
570570

571-
# An instantiated derivative of werkzeug.contrib.cache.BaseCache
571+
# An instantiated derivative of cachelib.base.BaseCache
572572
# if enabled, it can be used to store the results of long-running queries
573573
# in SQL Lab by using the "Run Async" button/feature
574574
RESULTS_BACKEND = None

tests/sql_parse_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ def test_select_if(self):
187187
# SHOW TABLES ((FROM | IN) qualifiedName)? (LIKE pattern=STRING)?
188188
def test_show_tables(self):
189189
query = "SHOW TABLES FROM s1 like '%order%'"
190-
# TODO: figure out what should code do here
191-
self.assertEqual({Table("s1")}, self.extract_tables(query))
190+
self.assertEqual(set(), self.extract_tables(query))
192191

193192
# SHOW COLUMNS (FROM | IN) qualifiedName
194193
def test_show_columns(self):

0 commit comments

Comments
 (0)