Skip to content
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

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

Open
pbeshai opened this issue May 7, 2021 · 0 comments
Open

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

pbeshai opened this issue May 7, 2021 · 0 comments
Labels
breaking For breaking changes question Further information is requested

Comments

@pbeshai
Copy link
Owner

pbeshai commented May 7, 2021

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.

@pbeshai pbeshai added breaking For breaking changes question Further information is requested labels May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking For breaking changes question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant