You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by el...@apache.org on 2021/12/21 00:35:03 UTC

[superset] branch 1.4 updated (1ac1899 -> 70228ad)

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

elizabeth pushed a change to branch 1.4
in repository https://gitbox.apache.org/repos/asf/superset.git.


    omit 1ac1899  chore: add release to pip requirements (#17752)
     new f4661d6  fix: Remove positions from json_metadata (#17766)
     new 70228ad  fix(dashboard): commit update once (#17781)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (1ac1899)
            \
             N -- N -- N   refs/heads/1.4 (70228ad)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .pre-commit-config.yaml                            |    2 +-
 requirements/base.in                               |    4 -
 requirements/base.txt                              |   20 +-
 requirements/development.txt                       |    9 +
 requirements/integration.in                        |    1 -
 requirements/integration.txt                       |    6 +-
 requirements/testing.txt                           |    2 +
 setup.py                                           |    1 -
 .../cypress/integration/dashboard/save.test.js     |    2 +-
 .../dashboard/components/PropertiesModal/index.tsx |    7 +-
 superset/common/query_object.py                    |    2 +
 superset/config.py                                 |    1 +
 superset/connectors/sqla/models.py                 |    4 +-
 superset/dashboards/commands/update.py             |    6 +-
 superset/dashboards/dao.py                         |    3 +
 superset/db_engine_specs/postgres.py               |    2 +-
 superset/utils/async_query_manager.py              |    8 +-
 tests/integration_tests/charts/api_tests.py        |    2 +
 tests/unit_tests/sql_parse_tests.py                | 1097 ++++++++++++++++++++
 19 files changed, 1140 insertions(+), 39 deletions(-)

[superset] 01/02: fix: Remove positions from json_metadata (#17766)

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f4661d6924b50f70cf79acc7ded1ca565537e7f5
Author: Geido <60...@users.noreply.github.com>
AuthorDate: Wed Dec 15 19:32:31 2021 +0100

    fix: Remove positions from json_metadata (#17766)
    
    * Remove positions from json_metadata
    
    * Update superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
    
    Co-authored-by: Kamil Gabryjelski <ka...@gmail.com>
    
    * Indent
    
    Co-authored-by: Kamil Gabryjelski <ka...@gmail.com>
    (cherry picked from commit 274fb37a917e78acd0711b754edf7b833f06911d)
---
 .../src/dashboard/components/PropertiesModal/index.tsx             | 7 ++++++-
 superset/dashboards/dao.py                                         | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx b/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
index 7e7ad24..83671d9 100644
--- a/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
+++ b/superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
@@ -161,10 +161,15 @@ const PropertiesModal = ({
 
       form.setFieldsValue(dashboardInfo);
       setDashboardInfo(dashboardInfo);
-      setJsonMetadata(metadata ? jsonStringify(metadata) : '');
       setOwners(owners);
       setRoles(roles);
       setColorScheme(metadata.color_scheme);
+
+      // temporary fix to remove positions from dashboards' metadata
+      if (metadata?.positions) {
+        delete metadata.positions;
+      }
+      setJsonMetadata(metadata ? jsonStringify(metadata) : '');
     },
     [form],
   );
diff --git a/superset/dashboards/dao.py b/superset/dashboards/dao.py
index 0692789..0443763 100644
--- a/superset/dashboards/dao.py
+++ b/superset/dashboards/dao.py
@@ -239,6 +239,9 @@ class DashboardDAO(BaseDAO):
             }
             md["default_filters"] = json.dumps(applicable_filters)
 
+            # positions have its own column, no need to store it in metadata
+            md.pop("positions", None)
+
         # The css and dashboard_title properties are not part of the metadata
         # TODO (geido): remove by refactoring/deprecating save_dash endpoint
         if data.get("css") is not None:

[superset] 02/02: fix(dashboard): commit update once (#17781)

Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 70228ad3fb68437357edd17751b57447a47fb4e7
Author: serenajiang <se...@airbnb.com>
AuthorDate: Thu Dec 16 11:49:40 2021 -0800

    fix(dashboard): commit update once (#17781)
    
    (cherry picked from commit 3657cbea7f5c37ccc06280b6c5230c1fdad76f9e)
---
 superset/dashboards/commands/update.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/superset/dashboards/commands/update.py b/superset/dashboards/commands/update.py
index 5384e45..2065437 100644
--- a/superset/dashboards/commands/update.py
+++ b/superset/dashboards/commands/update.py
@@ -34,6 +34,7 @@ from superset.dashboards.commands.exceptions import (
 )
 from superset.dashboards.dao import DashboardDAO
 from superset.exceptions import SupersetSecurityException
+from superset.extensions import db
 from superset.models.dashboard import Dashboard
 from superset.views.base import check_ownership
 
@@ -51,13 +52,14 @@ class UpdateDashboardCommand(UpdateMixin, BaseCommand):
         self.validate()
         try:
             dashboard = DashboardDAO.update(self._model, self._properties, commit=False)
-            dashboard = DashboardDAO.update_charts_owners(dashboard, commit=True)
+            dashboard = DashboardDAO.update_charts_owners(dashboard, commit=False)
             if self._properties.get("json_metadata"):
                 dashboard = DashboardDAO.set_dash_metadata(
                     dashboard,
                     data=json.loads(self._properties.get("json_metadata", "{}")),
-                    commit=True,
+                    commit=False,
                 )
+            db.session.commit()
         except DAOUpdateFailedError as ex:
             logger.exception(ex.exception)
             raise DashboardUpdateFailedError() from ex