[DO - enrichment] variable references in aggregation
See original GitHub issueComes from https://github.com/CartoDB/cartoframes/pull/1140#issuecomment-549366367
One thing I find confusing is how the agg_operators part works. When there are no aggregation operators specified it’s pretty clear (use the default, if available in the metadata agg_method field).
However, I find it weird that the user has to refer to a variable by slug (or ID, I suppose) but then specify the aggregation using the variable’s column_name as the dictionary key. I think this has several drawbacks:
-
I understand we specify variables to enrich (instead of full datasets) to allow enriching with variables from different datasets. But what if the variables have the same column_name in their respective datasets? For example, if I were to enrich my geometry with two population columns from different datasets (both called `pop), in order to compare them…
-
If I already know the slug (which uniquely identifies a variable), why not just use that for the agg_operators dict, too? Of course, that would imply looking up the proper column ID in the metadata (but we’re already doing that).
-
It’d be nice to be able to specify several aggregation functions for a single variable (just like Pandas does). In this case, we’d have to differentiate them somehow (maybe adding a {func}_ prefix?)
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
^ yeah! that’s is perfect IMO
🚀