-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
Implement range based grouping for numeric types. #384
Comments
@kgodey @ghislaineguerin Should the ranges have the same size on the number line, or the same number of entries? For example, if a column has entries
Should splitting into two groups result in
or
|
@mathemancer Good question. From the backend perspective, I think it makes sense to provide both options. The frontend (or other Mathesar clients) can use whichever would be best in the use case. |
@powellc FYI I updated the issue description with more details. |
As I've gotten into this:
I'm currently working on the assumption that the former bullet point makes sense, and we can have that functionality (even if we don't want it in the front end at the moment). For the second point, I think I'll start by just getting the range grouping working, then we can deprecate the other grouping form. @kgodey Does that make sense to you? |
@mathemancer That sounds fine to me. I think we'll want different frontend experiences for grouping by distinct tuples vs. range-based grouping, but there's no reason why the API can't be the same for both. |
Problem
Users may want to group their records by ranges such as 0-1, 1-2, 2-3, or 0-10, 10-20, 20-30, or 0-100, 100-200, 200-300, etc. The range that they will want to group on will depend on the kind of data they have. For example, if the values in a column range from 0.3 to 5.2, then grouping by 0-10, 10-20 etc. is not very useful.
We need to provide both useful ranges for a given column and the ability to group by them.
Solution
This involves:
Updating theThis will be done in Grouping description endpoint #1310/api/v0/databases/<id>/types/
endpoint to store available grouping on this typeAdditional context
NUMERIC
type which is already implemented.NUMERIC
data type in the backend. #377SMALLINT
data type in the backend. #378INTEGER
data type in the backend. #379BIGINT
data type in the backend. #380DECIMAL
data type in the backend. #381REAL
data type in the backend. #382DOUBLE PRECISION
data type in the backend. #383MATHESAR_TYPES.PERCENTAGE
type. #434The text was updated successfully, but these errors were encountered: