Skip to content

Commit

Permalink
chore(🦾): bump python flask-session 0.5.0 -> 0.8.0 (apache#27751)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Maxime Beauchemin <[email protected]>
  • Loading branch information
3 people authored and EnxDev committed Apr 12, 2024
1 parent 8f6c9f0 commit 9ca9f17
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
3 changes: 3 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ assists people when migrating to a new version.
files for production use cases! While we never really supported
or should have tried to support docker-compose for production use cases, we now actively
have taken a stance against supporting it. See the PR for details.
- [27697](https://github.com/apache/superset/pull/27697) [minor] flask-session bump leads to them
deprecating `SESSION_USE_SIGNER`, check your configs as this flag won't do anything moving
forward.

### Breaking Changes

Expand Down
4 changes: 3 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ flask-login==0.6.3
# flask-appbuilder
flask-migrate==3.1.0
# via apache-superset
flask-session==0.5.0
flask-session==0.8.0
# via apache-superset
flask-sqlalchemy==2.5.1
# via
Expand Down Expand Up @@ -214,6 +214,8 @@ mdurl==0.1.2
# via markdown-it-py
msgpack==1.0.8
# via apache-superset
msgspec==0.18.6
# via flask-session
nh3==0.2.17
# via apache-superset
numba==0.57.1
Expand Down
6 changes: 3 additions & 3 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
in your PYTHONPATH as there is a ``from superset_config import *``
at the end of this file.
"""
# mypy: ignore-errors
# pylint: disable=too-many-lines
from __future__ import annotations

Expand Down Expand Up @@ -940,7 +941,7 @@ class CeleryConfig: # pylint: disable=too-few-public-methods
}


CELERY_CONFIG = CeleryConfig # pylint: disable=invalid-name
CELERY_CONFIG: type[CeleryConfig] = CeleryConfig

# Set celery config to None to disable all the above configuration
# CELERY_CONFIG = None
Expand Down Expand Up @@ -1474,7 +1475,6 @@ def EMAIL_HEADER_MUTATOR( # pylint: disable=invalid-name,unused-argument
# from flask_session import RedisSessionInterface
#
# SESSION_SERVER_SIDE = True
# SESSION_USE_SIGNER = True
# SESSION_TYPE = "redis"
# SESSION_REDIS = Redis(host="localhost", port=6379, db=0)
#
Expand Down Expand Up @@ -1704,7 +1704,7 @@ class ExtraDynamicQueryFilters(TypedDict, total=False):
try:
# pylint: disable=import-error,wildcard-import,unused-wildcard-import
import superset_config
from superset_config import * # type: ignore
from superset_config import * # noqa: F403, F401

print(f"Loaded your LOCAL configuration at [{superset_config.__file__}]")
except Exception:
Expand Down
8 changes: 4 additions & 4 deletions superset/models/slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if TYPE_CHECKING:
from superset.common.query_context import QueryContext
from superset.common.query_context_factory import QueryContextFactory
from superset.connectors.sqla.models import BaseDatasource
from superset.connectors.sqla.models import SqlaTable

metadata = Model.metadata # pylint: disable=no-member
slice_user = Table(
Expand Down Expand Up @@ -139,14 +139,14 @@ def __repr__(self) -> str:
return self.slice_name or str(self.id)

@property
def cls_model(self) -> type[BaseDatasource]:
def cls_model(self) -> type[SqlaTable]:
# pylint: disable=import-outside-toplevel
from superset.daos.datasource import DatasourceDAO

return DatasourceDAO.sources[self.datasource_type]

@property
def datasource(self) -> BaseDatasource | None:
def datasource(self) -> SqlaTable | None:
return self.get_datasource

def clone(self) -> Slice:
Expand All @@ -163,7 +163,7 @@ def clone(self) -> Slice:

# pylint: disable=using-constant-test
@datasource.getter # type: ignore
def get_datasource(self) -> BaseDatasource | None:
def get_datasource(self) -> SqlaTable | None:
return (
db.session.query(self.cls_model)
.filter_by(id=self.datasource_id)
Expand Down
7 changes: 4 additions & 3 deletions tests/integration_tests/charts/commands_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def test_export_chart_command_no_related(self, mock_g):
class TestImportChartsCommand(SupersetTestCase):
@patch("superset.utils.core.g")
@patch("superset.security.manager.g")
def test_import_v1_chart(self, sm_g, utils_g):
def test_import_v1_chart(self, sm_g, utils_g) -> None:
"""Test that we can import a chart"""
admin = sm_g.user = utils_g.user = security_manager.find_user("admin")
contents = {
Expand All @@ -192,7 +192,7 @@ def test_import_v1_chart(self, sm_g, utils_g):
assert json.loads(chart.params) == {
"annotation_layers": [],
"color_picker": {"a": 1, "b": 135, "g": 122, "r": 0},
"datasource": dataset.uid,
"datasource": dataset.uid if dataset else None,
"js_columns": ["color"],
"js_data_mutator": "data => data.map(d => ({\\n ...d,\\n color: colors.hexToRGB(d.extraProps.color)\\n}));",
"js_onclick_href": "",
Expand Down Expand Up @@ -228,7 +228,8 @@ def test_import_v1_chart(self, sm_g, utils_g):
dataset = (
db.session.query(SqlaTable).filter_by(uuid=dataset_config["uuid"]).one()
)
assert dataset.table_name == "imported_dataset"
table_name = dataset.table_name if dataset else None
assert table_name == "imported_dataset"
assert chart.table == dataset

database = (
Expand Down

0 comments on commit 9ca9f17

Please sign in to comment.