Skip to content

Should groupBy's addGroupKeys be on by default? #38

Open
@pbeshai

Description

@pbeshai

Currently groupBy automatically adds group keys back to objects after each function in the flow. This was primarily done to mitigate the fact that summarize (a very common groupBy operation) removes them. There has been some discussion in #34 around whether or not this should be default behavior.

It's a pretty big breaking change to switch to not adding them by default, so I'm not sure it will be worth it. However, it would improve the performance of groupBy and perhaps it is easier to reason about by not adding them (users can always explicitly keep them around when summarizing via first (e.g. summarize({ cyl: first('cyl') })).

An in-between would be to not add them in except for certain exports? It's likely when exporting by entries or object you don't want them added back in. I'm not sure what to do here, and am open to any ideas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingFor breaking changesquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions