[incubator-superset] branch master updated: logo gets the vertically-centered flexbox treatment in jinja template (#10281)

2020-07-10 Thread rusackas
This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 06fd1b5  logo gets the vertically-centered flexbox treatment in jinja 
template (#10281)
06fd1b5 is described below

commit 06fd1b5e4d9ab41d90ae1fcad79f6edfe3e820e2
Author: Evan Rusackas 
AuthorDate: Fri Jul 10 16:11:49 2020 -0700

logo gets the vertically-centered flexbox treatment in jinja template 
(#10281)
---
 superset-frontend/stylesheets/superset.less | 8 
 1 file changed, 8 insertions(+)

diff --git a/superset-frontend/stylesheets/superset.less 
b/superset-frontend/stylesheets/superset.less
index 2eca35e..36b0113 100644
--- a/superset-frontend/stylesheets/superset.less
+++ b/superset-frontend/stylesheets/superset.less
@@ -552,3 +552,11 @@ td.filtered {
 .select2-container-multi {
   width: 100% !important;
 }
+
+// Remove this when the jinja menu/navbar is replaced with react.
+// This style already exists in that view
+.navbar-brand {
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}



[incubator-superset] branch john-bodley--silence-thumbnail-cache-warning created (now 706f41b)

2020-07-10 Thread johnbodley
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a change to branch 
john-bodley--silence-thumbnail-cache-warning
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.


  at 706f41b  chore: Silencing unused thumbnail cache config

This branch includes the following new commits:

 new 706f41b  chore: Silencing unused thumbnail cache config

The 1 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.




[incubator-superset] 01/01: chore: Silencing unused thumbnail cache config

2020-07-10 Thread johnbodley
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch 
john-bodley--silence-thumbnail-cache-warning
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 706f41bba4474cf90064ce381a3ddba8becd9bdf
Author: John Bodley <4567245+john-bod...@users.noreply.github.com>
AuthorDate: Fri Jul 10 16:02:20 2020 -0700

chore: Silencing unused thumbnail cache config
---
 superset/config.py | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/superset/config.py b/superset/config.py
index 74e7fec..0760bb8 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -333,7 +333,10 @@ GET_FEATURE_FLAGS_FUNC: Optional[Callable[[Dict[str, 
bool]], Dict[str, bool]]] =
 # Thumbnail config (behind feature flag)
 # ---
 THUMBNAIL_SELENIUM_USER = "Admin"
-THUMBNAIL_CACHE_CONFIG: CacheConfig = {"CACHE_TYPE": "null"}
+THUMBNAIL_CACHE_CONFIG: CacheConfig = {
+"CACHE_TYPE": "null",
+"CACHE_NO_NULL_WARNING": True,
+}
 
 # ---
 # Image and file configuration



[incubator-superset] branch master updated: style: new toast design closer to SIP-34 (#10178)

2020-07-10 Thread tai
This is an automated email from the ASF dual-hosted git repository.

tai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 3b4df51  style: new toast design closer to SIP-34 (#10178)
3b4df51 is described below

commit 3b4df51848f1ff3b4f22771eacdd49e77077125d
Author: Lily Kuang 
AuthorDate: Fri Jul 10 14:58:59 2020 -0700

style: new toast design closer to SIP-34 (#10178)
---
 superset-frontend/images/icons/check.svg   |  22 +
 superset-frontend/images/icons/error.svg   |  22 +
 .../dashboard/components/DashboardBuilder_spec.jsx |   5 +
 .../components/ToastPresenter_spec.jsx |   4 +-
 .../messageToasts/components/Toast_spec.jsx|  24 ++---
 .../javascripts/sqllab/TabbedSqlEditors_spec.jsx   |   7 ++
 superset-frontend/src/components/Icon.tsx  |   6 ++
 .../src/messageToasts/components/Toast.jsx | 109 -
 .../src/messageToasts/components/Toast.tsx |  93 ++
 .../messageToasts/components/ToastPresenter.jsx|  56 ---
 .../messageToasts/components/ToastPresenter.tsx|  91 +
 .../src/messageToasts/stylesheets/toast.less   |  78 ---
 superset-frontend/src/messageToasts/types.ts   |  24 +
 13 files changed, 285 insertions(+), 256 deletions(-)

diff --git a/superset-frontend/images/icons/check.svg 
b/superset-frontend/images/icons/check.svg
new file mode 100644
index 000..7f6fd6e
--- /dev/null
+++ b/superset-frontend/images/icons/check.svg
@@ -0,0 +1,22 @@
+
+http://www.w3.org/2000/svg;>
+
+
diff --git a/superset-frontend/images/icons/error.svg 
b/superset-frontend/images/icons/error.svg
new file mode 100644
index 000..03c1962
--- /dev/null
+++ b/superset-frontend/images/icons/error.svg
@@ -0,0 +1,22 @@
+
+http://www.w3.org/2000/svg;>
+
+
+
diff --git 
a/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
 
b/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
index dbdee6a..04d885e 100644
--- 
a/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/dashboard/components/DashboardBuilder_spec.jsx
@@ -22,6 +22,7 @@ import { shallow, mount } from 'enzyme';
 import sinon from 'sinon';
 
 import { ParentSize } from '@vx/responsive';
+import { supersetTheme, ThemeProvider } from '@superset-ui/style';
 import { Sticky, StickyContainer } from 'react-sticky';
 import { TabContainer, TabContent, TabPane } from 'react-bootstrap';
 
@@ -77,6 +78,10 @@ describe('DashboardBuilder', () => {
   
 {builder}
   ,
+  {
+wrappingComponent: ThemeProvider,
+wrappingComponentProps: { theme: supersetTheme },
+  },
 )
   : shallow(builder);
   }
diff --git 
a/superset-frontend/spec/javascripts/messageToasts/components/ToastPresenter_spec.jsx
 
b/superset-frontend/spec/javascripts/messageToasts/components/ToastPresenter_spec.jsx
index d888dad..9b3e4a0 100644
--- 
a/superset-frontend/spec/javascripts/messageToasts/components/ToastPresenter_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/messageToasts/components/ToastPresenter_spec.jsx
@@ -34,9 +34,9 @@ describe('ToastPresenter', () => {
 return wrapper;
   }
 
-  it('should render a div with class toast-presenter', () => {
+  it('should render a div with id toast-presenter', () => {
 const wrapper = setup();
-expect(wrapper.find('.toast-presenter')).toHaveLength(1);
+expect(wrapper.find('#toast-presenter')).toHaveLength(1);
   });
 
   it('should render a Toast for each toast object', () => {
diff --git 
a/superset-frontend/spec/javascripts/messageToasts/components/Toast_spec.jsx 
b/superset-frontend/spec/javascripts/messageToasts/components/Toast_spec.jsx
index a37b834..d411093 100644
--- a/superset-frontend/spec/javascripts/messageToasts/components/Toast_spec.jsx
+++ b/superset-frontend/spec/javascripts/messageToasts/components/Toast_spec.jsx
@@ -19,21 +19,19 @@
 import { Alert } from 'react-bootstrap';
 import React from 'react';
 import { mount } from 'enzyme';
+import { act } from 'react-dom/test-utils';
 import Toast from 'src/messageToasts/components/Toast';
 
 import mockMessageToasts from '../mockMessageToasts';
 
-describe('Toast', () => {
-  const props = {
-toast: mockMessageToasts[0],
-onCloseToast() {},
-  };
+const props = {
+  toast: mockMessageToasts[0],
+  onCloseToast() {},
+};
 
-  function setup(overrideProps) {
-const wrapper = mount();
-return wrapper;
-  }
+const setup = overrideProps => mount();
 
+describe('Toast', () => {
   it('should render an Alert', () => {
 const wrapper = setup();
 expect(wrapper.find(Alert)).toHaveLength(1);
@@ -52,9 +50,13 @@ describe('Toast', () => {
 expect(id).toBe(props.toast.id);
  

[incubator-superset] branch master updated (4d17962 -> 80b06f6)

2020-07-10 Thread suddjian
This is an automated email from the ASF dual-hosted git repository.

suddjian pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git.


from 4d17962  fix(explore): edit datasource does not update control states 
(#10284)
 add 80b06f6  feat: update delete modal for dataset (#10258)

No new revisions were added by this update.

Summary of changes:
 .../components/ConfirmStatusChange_spec.jsx|   8 +-
 .../src/components/ConfirmStatusChange.tsx |  78 ++--
 superset-frontend/src/components/DeleteModal.tsx   |  80 
 .../{views/datasetList => components}/Modal.tsx|  25 +-
 superset-frontend/src/views/datasetList/Button.tsx |   7 +-
 .../src/views/datasetList/DatasetList.tsx  | 482 +++--
 .../src/views/datasetList/DatasetModal.tsx | 121 +++---
 7 files changed, 446 insertions(+), 355 deletions(-)
 create mode 100644 superset-frontend/src/components/DeleteModal.tsx
 rename superset-frontend/src/{views/datasetList => components}/Modal.tsx (82%)



[incubator-superset] branch master updated: fix(explore): edit datasource does not update control states (#10284)

2020-07-10 Thread yjc
This is an automated email from the ASF dual-hosted git repository.

yjc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 4d17962  fix(explore): edit datasource does not update control states 
(#10284)
4d17962 is described below

commit 4d179622fa7f11c7ebf28bb5eb5f88069340498a
Author: Jesse Yang 
AuthorDate: Fri Jul 10 12:46:25 2020 -0700

fix(explore): edit datasource does not update control states (#10284)
---
 .../explore/{control.test.js => control.test.ts}   | 55 +-
 .../explore/components/DatasourceControl_spec.jsx  |  9 ++--
 .../spec/javascripts/explore/controlUtils_spec.jsx |  1 -
 .../src/components/TooltipWrapper.jsx  |  6 +++
 .../explore/components/ExploreViewContainer.jsx|  1 +
 .../components/controls/DatasourceControl.jsx  | 20 ++--
 superset-frontend/src/explore/controlUtils.js  |  3 +-
 superset-frontend/src/explore/controls.jsx |  6 +--
 8 files changed, 86 insertions(+), 15 deletions(-)

diff --git 
a/superset-frontend/cypress-base/cypress/integration/explore/control.test.js 
b/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts
similarity index 57%
rename from 
superset-frontend/cypress-base/cypress/integration/explore/control.test.js
rename to 
superset-frontend/cypress-base/cypress/integration/explore/control.test.ts
index e2da3a6..d7a4509 100644
--- a/superset-frontend/cypress-base/cypress/integration/explore/control.test.js
+++ b/superset-frontend/cypress-base/cypress/integration/explore/control.test.ts
@@ -21,11 +21,60 @@
 // ***
 import { FORM_DATA_DEFAULTS, NUM_METRIC } from 
'./visualizations/shared.helper';
 
-describe('Groupby', () => {
-  it('Set groupby', () => {
+describe('Datasource control', () => {
+  const newMetricName = `abc${Date.now()}`;
+
+  before(() => {
 cy.server();
 cy.login();
+cy.route('GET', '/superset/explore_json/**').as('getJson');
+cy.route('POST', '/superset/explore_json/**').as('postJson');
+  });
 
+  it('should allow edit datasource', () => {
+cy.visitChartByName('Num Births Trend');
+cy.verifySliceSuccess({ waitAlias: '@postJson' });
+cy.get('#datasource_menu').click();
+cy.get('a').contains('Edit Datasource').click();
+// create new metric
+cy.get('button').contains('Add Item').click();
+cy.get('input[value=""]').click();
+cy.get('input[value=""]')
+  .focus()
+  .clear()
+  .type(`${newMetricName}{enter}`);
+cy.get('.modal-footer button').contains('Save').click();
+cy.get('.modal-footer button').contains('OK').click();
+// select new metric
+cy.get('.metrics-select:eq(0)').click();
+cy.get('.metrics-select:eq(0) input[type="text"]')
+  .focus()
+  .type(newMetricName);
+cy.get('.metrics-select:eq(0) .Select__menu .Select__option')
+  .contains(newMetricName)
+  .click();
+cy.get('.metrics-select:eq(0) .Select__multi-value__label')
+  .contains(newMetricName)
+  .click();
+// delete metric
+cy.get('#datasource_menu').click();
+cy.get('a').contains('Edit Datasource').click();
+cy.get(`input[value="${newMetricName}"]`)
+  .closest('tr')
+  .find('.fa-close')
+  .click();
+cy.get('.modal-footer button').contains('Save').click();
+cy.get('.modal-footer button').contains('OK').click();
+cy.get('.Select__multi-value__label')
+  .contains(newMetricName)
+  .should('not.exist');
+  });
+});
+
+describe('Groupby control', () => {
+  it('Set groupby', () => {
+cy.server();
+cy.login();
 cy.route('GET', '/superset/explore_json/**').as('getJson');
 cy.route('POST', '/superset/explore_json/**').as('postJson');
 cy.visitChartByName('Num Births Trend');
@@ -71,5 +120,7 @@ describe('Time range filter', () => {
 });
   });
 });
+cy.get('#filter-popover button').contains('Ok').click();
+cy.get('#filter-popover').should('not.exist');
   });
 });
diff --git 
a/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx
 
b/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx
index 60a2308..2fc0b01 100644
--- 
a/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx
+++ 
b/superset-frontend/spec/javascripts/explore/components/DatasourceControl_spec.jsx
@@ -41,6 +41,9 @@ const defaultProps = {
   name: 'main',
 },
   },
+  actions: {
+setDatasource: sinon.spy(),
+  },
   onChange: sinon.spy(),
 };
 
@@ -71,15 +74,15 @@ describe('DatasourceControl', () => {
 let wrapper = setup();
 expect(wrapper.find('#datasource_menu')).toHaveLength(1);
 
expect(wrapper.find('#datasource_menu').dive().find(MenuItem)).toHaveLength(
-  2,
+  3,
 );
 
 wrapper = setup({
-  onDatasourceSave: () => {},
+  

[incubator-superset] branch master updated: chore: Releasing SQL Lab Celery results (#10279)

2020-07-10 Thread johnbodley
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 4e4ccd4  chore: Releasing SQL Lab Celery results (#10279)
4e4ccd4 is described below

commit 4e4ccd48d64adf187dbc682ebf68a3954a37b943
Author: John Bodley <4567245+john-bod...@users.noreply.github.com>
AuthorDate: Fri Jul 10 09:53:57 2020 -0700

chore: Releasing SQL Lab Celery results (#10279)

Co-authored-by: John Bodley 
---
 superset/views/core.py | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index fea37b9..bce09963 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -2101,7 +2101,7 @@ class Superset(BaseSupersetView):  # pylint: 
disable=too-many-public-methods
 logger.info("Query %i: Running query on a Celery worker", query.id)
 # Ignore the celery future object and the request may time out.
 try:
-sql_lab.get_sql_results.delay(
+task = sql_lab.get_sql_results.delay(
 query.id,
 rendered_query,
 return_results=False,
@@ -2111,6 +2111,10 @@ class Superset(BaseSupersetView):  # pylint: 
disable=too-many-public-methods
 expand_data=expand_data,
 log_params=log_params,
 )
+
+# Explicitly forget the task to ensure the task metadata is 
removed from the
+# Celery results backend in a timely manner.
+task.forget()
 except Exception as ex:  # pylint: disable=broad-except
 logger.exception("Query %i: %s", query.id, str(ex))
 msg = _(



[incubator-superset] branch master updated: chore: Bumping Celery (#10280)

2020-07-10 Thread johnbodley
This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 3f2f5e8  chore: Bumping Celery (#10280)
3f2f5e8 is described below

commit 3f2f5e831147abdf9f172fca0d0d3dc5092c
Author: John Bodley <4567245+john-bod...@users.noreply.github.com>
AuthorDate: Fri Jul 10 09:12:12 2020 -0700

chore: Bumping Celery (#10280)

Co-authored-by: John Bodley 
---
 requirements.txt | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/requirements.txt b/requirements.txt
index 3b6292d..20579d8 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,7 +6,7 @@
 #
 aiohttp==3.6.2# via slackclient
 alembic==1.4.2# via flask-migrate
-amqp==2.5.2   # via kombu
+amqp==2.6.0   # via kombu
 apispec[yaml]==3.3.1  # via flask-appbuilder
 async-timeout==3.0.1  # via aiohttp
 attrs==19.3.0 # via aiohttp, jsonschema
@@ -16,7 +16,7 @@ billiard==3.6.3.0 # via celery
 bleach==3.1.5 # via apache-superset (setup.py)
 brotli==1.0.7 # via flask-compress
 cachelib==0.1.1   # via apache-superset (setup.py)
-celery==4.4.2 # via apache-superset (setup.py)
+celery==4.4.6 # via apache-superset (setup.py)
 cffi==1.14.0  # via cryptography
 chardet==3.0.4# via aiohttp
 click==7.1.2  # via apache-superset (setup.py), flask, 
flask-appbuilder
@@ -41,6 +41,7 @@ flask-sqlalchemy==2.4.1   # via flask-appbuilder, 
flask-migrate
 flask-talisman==0.7.0 # via apache-superset (setup.py)
 flask-wtf==0.14.3 # via apache-superset (setup.py), flask-appbuilder
 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
+future==0.18.2# via celery
 geographiclib==1.50   # via geopy
 geopy==1.22.0 # via apache-superset (setup.py)
 gunicorn==20.0.4  # via apache-superset (setup.py)
@@ -52,7 +53,7 @@ isodate==0.6.0# via apache-superset (setup.py)
 itsdangerous==1.1.0   # via flask, flask-wtf
 jinja2==2.11.2# via flask, flask-babel
 jsonschema==3.2.0 # via flask-appbuilder
-kombu==4.6.8  # via celery
+kombu==4.6.11 # via celery
 mako==1.1.2   # via alembic
 markdown==3.2.2   # via apache-superset (setup.py)
 markupsafe==1.1.1 # via jinja2, mako, wtforms



[incubator-superset] branch master updated: feat: add contribution operation and fix cache_key bug (#10286)

2020-07-10 Thread villebro
This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
 new 14260f9  feat: add contribution operation and fix cache_key bug 
(#10286)
14260f9 is described below

commit 14260f984334c0adedf813cd821f3fc92d3a2bae
Author: Ville Brofeldt <33317356+ville...@users.noreply.github.com>
AuthorDate: Fri Jul 10 17:06:05 2020 +0300

feat: add contribution operation and fix cache_key bug (#10286)

* feat: add contribution operation and fix cache_key_bug

* Add contribution schema
---
 superset/charts/schemas.py  | 17 -
 superset/common/query_object.py |  8 +---
 superset/utils/core.py  |  9 +
 superset/utils/pandas_postprocessing.py | 31 +--
 tests/charts/schema_tests.py| 10 ++
 tests/pandas_postprocessing_tests.py| 29 -
 tests/query_context_tests.py| 27 +++
 7 files changed, 124 insertions(+), 7 deletions(-)

diff --git a/superset/charts/schemas.py b/superset/charts/schemas.py
index 8ab4859..4f2e3f0 100644
--- a/superset/charts/schemas.py
+++ b/superset/charts/schemas.py
@@ -395,6 +395,19 @@ class 
ChartDataSortOptionsSchema(ChartDataPostProcessingOperationOptionsSchema):
 aggregates = ChartDataAggregateConfigField()
 
 
+class 
ChartDataContributionOptionsSchema(ChartDataPostProcessingOperationOptionsSchema):
+"""
+Contribution operation config.
+"""
+
+orientation = fields.String(
+description="Should cell values be calculated across the row or 
column.",
+required=True,
+validate=validate.OneOf(choices=("row", "column",)),
+example="row",
+)
+
+
 class 
ChartDataPivotOptionsSchema(ChartDataPostProcessingOperationOptionsSchema):
 """
 Pivot operation config.
@@ -500,6 +513,7 @@ class ChartDataPostProcessingOperationSchema(Schema):
 validate=validate.OneOf(
 choices=(
 "aggregate",
+"contribution",
 "cum",
 "geodetic_parse",
 "geohash_decode",
@@ -637,7 +651,7 @@ class ChartDataQueryObjectSchema(Schema):
 "`ChartDataAdhocMetricSchema` for the structure of ad-hoc metrics.",
 )
 post_processing = fields.List(
-fields.Nested(ChartDataPostProcessingOperationSchema),
+fields.Nested(ChartDataPostProcessingOperationSchema, allow_none=True),
 description="Post processing operations to be applied to the result 
set. "
 "Operations are applied to the result set in sequential order.",
 )
@@ -812,6 +826,7 @@ CHART_DATA_SCHEMAS = (
 #  by Marshmallow<3, this is not currently possible.
 ChartDataAdhocMetricSchema,
 ChartDataAggregateOptionsSchema,
+ChartDataContributionOptionsSchema,
 ChartDataPivotOptionsSchema,
 ChartDataRollingOptionsSchema,
 ChartDataSelectOptionsSchema,
diff --git a/superset/common/query_object.py b/superset/common/query_object.py
index 8de2165..a2676b9 100644
--- a/superset/common/query_object.py
+++ b/superset/common/query_object.py
@@ -94,7 +94,7 @@ class QueryObject:
 extras: Optional[Dict[str, Any]] = None,
 columns: Optional[List[str]] = None,
 orderby: Optional[List[List[str]]] = None,
-post_processing: Optional[List[Dict[str, Any]]] = None,
+post_processing: Optional[List[Optional[Dict[str, Any = None,
 **kwargs: Any,
 ):
 metrics = metrics or []
@@ -114,7 +114,9 @@ class QueryObject:
 self.is_timeseries = is_timeseries
 self.time_range = time_range
 self.time_shift = utils.parse_human_timedelta(time_shift)
-self.post_processing = post_processing or []
+self.post_processing = [
+post_proc for post_proc in post_processing or [] if post_proc
+]
 if not is_sip_38:
 self.groupby = groupby or []
 
@@ -224,9 +226,9 @@ class QueryObject:
 del cache_dict[k]
 if self.time_range:
 cache_dict["time_range"] = self.time_range
-json_data = self.json_dumps(cache_dict, sort_keys=True)
 if self.post_processing:
 cache_dict["post_processing"] = self.post_processing
+json_data = self.json_dumps(cache_dict, sort_keys=True)
 return hashlib.md5(json_data.encode("utf-8")).hexdigest()
 
 def json_dumps(self, obj: Any, sort_keys: bool = False) -> str:
diff --git a/superset/utils/core.py b/superset/utils/core.py
index 9edee1c..c464d78 100644
--- a/superset/utils/core.py
+++ b/superset/utils/core.py
@@ -1476,3 +1476,12 @@ class TemporalType(str, Enum):
 TEXT = "TEXT"
 TIME = "TIME"
 TIMESTAMP = "TIMESTAMP"
+
+
+class PostProcessingContributionOrientation(str,