-
Notifications
You must be signed in to change notification settings - Fork 16.6k
fix: dedup groupby in viz.py while preserving order #10633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -322,7 +322,8 @@ def query_obj(self) -> QueryObjectDict: | |||||
| gb = self.groupby | ||||||
| metrics = self.all_metrics or [] | ||||||
| columns = form_data.get("columns") or [] | ||||||
| groupby = list(set(gb + columns)) | ||||||
| # merge list and dedup while preserving order | ||||||
| groupby = list(OrderedDict.fromkeys(gb + columns)) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit, as of 3.7 key order is now officially guaranteed (already implicitly so in 3.6), so no need to use
Suggested change
Reference: https://docs.python.org/3.7/tutorial/datastructures.html#dictionaries
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh right, I remember reading about how ordering is guaranteed in py3. |
||||||
|
|
||||||
| is_timeseries = self.is_timeseries | ||||||
| if DTTM_ALIAS in groupby: | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bycatch, the mypy commit hook was triggering on this...