You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2024/03/07 18:52:19 UTC

(superset) 01/01: fix: missing shared color in mixed timeseries (#27403)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 4.0
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5b6e5e475ef8f6768e347ba0b172e1e31029c232
Author: JUST.in DO IT <ju...@airbnb.com>
AuthorDate: Thu Mar 7 10:04:49 2024 -0800

    fix: missing shared color in mixed timeseries (#27403)
    
    (cherry picked from commit 9ced2552dbeeaf60217b385d4c40cbaf4372c787)
---
 .../plugin-chart-echarts/src/MixedTimeseries/transformProps.ts      | 5 +++--
 superset/commands/base.py                                           | 2 +-
 tests/unit_tests/security/api_test.py                               | 6 +++++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
index bb719c23e1..7488d49dba 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
@@ -410,8 +410,9 @@ export default function transformProps(
 
   rawSeriesB.forEach(entry => {
     const entryName = String(entry.name || '');
-    const seriesName = `${inverted[entryName] || entryName} (1)`;
-    const colorScaleKey = getOriginalSeries(seriesName, array);
+    const seriesEntry = inverted[entryName] || entryName;
+    const seriesName = `${seriesEntry} (1)`;
+    const colorScaleKey = getOriginalSeries(seriesEntry, array);
 
     const seriesFormatter = getFormatter(
       customFormattersSecondary,
diff --git a/superset/commands/base.py b/superset/commands/base.py
index 8b330d0669..d2efcda4fe 100644
--- a/superset/commands/base.py
+++ b/superset/commands/base.py
@@ -58,7 +58,7 @@ class CreateMixin:  # pylint: disable=too-few-public-methods
         return populate_owner_list(owner_ids, default_to_user=True)
 
 
-class UpdateMixin:  # pylint: disable=too-few-public-methods
+class UpdateMixin:
     @staticmethod
     def populate_owners(owner_ids: Optional[list[int]] = None) -> list[User]:
         """
diff --git a/tests/unit_tests/security/api_test.py b/tests/unit_tests/security/api_test.py
index 5d596073e9..73227166c2 100644
--- a/tests/unit_tests/security/api_test.py
+++ b/tests/unit_tests/security/api_test.py
@@ -28,4 +28,8 @@ def test_csrf_not_exempt(app_context: None) -> None:
     """
     Test that REST API is not exempt from CSRF.
     """
-    assert csrf._exempt_blueprints == {"MenuApi", "SecurityApi", "OpenApi"}
+    assert {blueprint.name for blueprint in csrf._exempt_blueprints} == {
+        "MenuApi",
+        "SecurityApi",
+        "OpenApi",
+    }