john-bodley commented on code in PR #19966:
URL: https://github.com/apache/superset/pull/19966#discussion_r868858167


##########
superset/examples/misc_dashboard.py:
##########
@@ -211,11 +210,7 @@ def load_misc_dashboard() -> None:
     """
     )
     pos = json.loads(js)
-    slices = (
-        
db.session.query(Slice).filter(Slice.slice_name.in_(misc_dash_slices)).all()
-    )
-    slices = sorted(slices, key=lambda x: x.id)
-    update_slice_ids(pos, slices)
+    pos, slices = update_slice_ids(pos)

Review Comment:
   Shouldn’t this be `slices = …`?



##########
superset/examples/helpers.py:
##########
@@ -39,17 +39,25 @@ def get_examples_folder() -> str:
     return os.path.join(app.config["BASE_DIR"], "examples")
 
 
-def update_slice_ids(layout_dict: Dict[Any, Any], slices: List[Slice]) -> None:
-    charts = [
+def update_slice_ids(pos: Dict[Any, Any]) -> List[Slice]:

Review Comment:
   Why not return a set if order isn’t relevant?



##########
superset/models/dashboard.py:
##########
@@ -218,7 +220,7 @@ def filter_sets_lst(self) -> Dict[int, FilterSet]:
         }
 
     @property
-    def charts(self) -> List[BaseDatasource]:
+    def charts(self) -> List[str]:

Review Comment:
   How/why wasn’t this caught by Mypy?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to