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/05/10 06:26:32 UTC
[GitHub] [superset] john-bodley commented on a diff in pull request #19966: test: make tabbed dashboard a little more complex
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: 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