-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
add warning_three_column_groupby #3115
Conversation
@jezdez I can't add you as a reviewer, but a heads up that this is ready to review. |
Here's a valid chart this doesn't let me save: (https://deploy-preview-3115--redash-preview.netlify.com/queries/22/source#32) The data is: month, # of issues, # of pull requests. There is no problem of plotting each one of them on its own or both of them together. The issue you seem to try and overcome is when there are multiple Y values for a single X value (#1742). But this needs to be checked after the data is arranged into series. Also following the discussion in #1742 and in the forum, I inclining towards conceding to applying an aggregation in such cases... |
@@ -32,6 +38,24 @@ const EditVisualizationDialog = { | |||
this.visualization = this.newVisualization(); | |||
} | |||
|
|||
this.has3plusColumnsFunction = () => { | |||
let has3plusColumns = false; | |||
if ((JSON.stringify(this.visualization.options.columnMapping).match(/,/g) || []).length > 1) { |
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.
Why this and not _.size?
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.
Great point - a way easier read. My brain just got stuck on it being a string.
|
||
this.disableSubmit = () => { | ||
if (this.has3plusColumnsFunction() && | ||
JSON.stringify(this.visualization.options.columnMapping).includes('unused') && |
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.
I have a query where one of the columns named "unused"... so this is not so reliable.
But this can be tested with values(this.visualization.options.columnMapping).includes('unused')
.
(values
is imported from lodash
)
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.
Thanks!
@arikfr I have to say I personally agree with the "applying an aggregation in such cases" route. It's a more elegant solution for the user as long as they get information about why they can't disable the aggregation if they attempt to disable it. Therefore I am not going to pursue the bug you found about multiple measures. @jezdez FYI. |
As this introduces more issues than solving anything, I'm closing this. I'm happy to discuss a potential solution along the lines of what I mentioned in the end of my previous comment. Closing this now. |
See mozilla#555 - this is a port upstream of a Mozilla feature.
This PR will
Error state:

Post-error state:
