You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/04/29 21:46:54 UTC

[GitHub] [superset] hughhhh opened a new pull request, #19904: Hugh/power-chart-query

hughhhh opened a new pull request, #19904:
URL: https://github.com/apache/superset/pull/19904

   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] hughhhh closed pull request #19904: feat(sip-68): Allow explore/form_data cache to accept sl_id + sl_type for downstream queries execution

Posted by GitBox <gi...@apache.org>.
hughhhh closed pull request #19904: feat(sip-68): Allow explore/form_data cache to accept sl_id + sl_type for downstream queries execution
URL: https://github.com/apache/superset/pull/19904


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] eschutho commented on a diff in pull request #19904: feat(sip-68): Allow explore/form_data cache to accept sl_id + sl_type for downstream queries execution

Posted by GitBox <gi...@apache.org>.
eschutho commented on code in PR #19904:
URL: https://github.com/apache/superset/pull/19904#discussion_r865463649


##########
superset/explore/form_data/commands/create.py:
##########
@@ -44,18 +45,48 @@ def run(self) -> str:
             tab_id = self._cmd_params.tab_id
             actor = self._cmd_params.actor
             form_data = self._cmd_params.form_data
-            check_access(dataset_id, chart_id, actor)
-            contextual_key = cache_key(session.get("_id"), tab_id, dataset_id, chart_id)
-            key = cache_manager.explore_form_data_cache.get(contextual_key)
-            if not key or not tab_id:
-                key = random_key()
-            if form_data:
-                state: TemporaryExploreState = {
+            sl_id = self._cmd_params.sl_id
+            sl_type = self._cmd_params.sl_type
+
+            state: Optional[TemporaryExploreState] = None
+
+            if form_data and dataset_id:
+                check_access(dataset_id, chart_id, actor)
+                contextual_key = cache_key(
+                    session.get("_id"), tab_id, dataset_id, chart_id
+                )
+                state = {
                     "owner": actor.get_user_id(),
                     "dataset_id": dataset_id,
                     "chart_id": chart_id,
                     "form_data": form_data,
+                    "sl_id": None,
+                    "sl_type": None,
+                }
+
+            elif form_data and sl_type and sl_id:

Review Comment:
   So, I think we're going to want to keep form_data cache or Queries, just not the data_cache (if it's simpler to exclude it). If we don't have form data cache, then people won't be able to send this page to anyone.



##########
superset/explore/form_data/commands/create.py:
##########
@@ -44,18 +45,48 @@ def run(self) -> str:
             tab_id = self._cmd_params.tab_id
             actor = self._cmd_params.actor
             form_data = self._cmd_params.form_data
-            check_access(dataset_id, chart_id, actor)
-            contextual_key = cache_key(session.get("_id"), tab_id, dataset_id, chart_id)
-            key = cache_manager.explore_form_data_cache.get(contextual_key)
-            if not key or not tab_id:
-                key = random_key()
-            if form_data:
-                state: TemporaryExploreState = {
+            sl_id = self._cmd_params.sl_id
+            sl_type = self._cmd_params.sl_type
+
+            state: Optional[TemporaryExploreState] = None
+
+            if form_data and dataset_id:
+                check_access(dataset_id, chart_id, actor)
+                contextual_key = cache_key(
+                    session.get("_id"), tab_id, dataset_id, chart_id
+                )
+                state = {
                     "owner": actor.get_user_id(),
                     "dataset_id": dataset_id,
                     "chart_id": chart_id,
                     "form_data": form_data,
+                    "sl_id": None,
+                    "sl_type": None,
+                }
+
+            elif form_data and sl_type and sl_id:

Review Comment:
   So, I think we're going to want to keep form_data cache or Queries, just not the data_cache (if it's simpler to exclude it). If we don't have form data cache, then people won't be able to send this page to anyone.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] eschutho commented on a diff in pull request #19904: feat(sip-68): Allow explore/form_data cache to accept sl_id + sl_type for downstream queries execution

Posted by GitBox <gi...@apache.org>.
eschutho commented on code in PR #19904:
URL: https://github.com/apache/superset/pull/19904#discussion_r865463263


##########
superset/explore/form_data/api.py:
##########
@@ -109,7 +109,9 @@ def post(self) -> Response:
             tab_id = request.args.get("tab_id")
             args = CommandParameters(
                 actor=g.user,
-                dataset_id=item["dataset_id"],
+                sl_id=item.get("sl_id"),
+                sl_type=item.get("sl_type"),
+                dataset_id=item.get("dataset_id"),

Review Comment:
   I don't think we'll need dataset_id any more. Can we just make this a more generic datasource_id and datasource_type and then remove dataset_id? Or is there something else preventing us from renaming this field?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org