-
Notifications
You must be signed in to change notification settings - Fork 35
Store.groupby enhancements #670
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
base: main
Are you sure you want to change the base?
Conversation
|
This pull request introduces 2 alerts when merging c30d05c into e44b5af - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging fd14a6f into e44b5af - view on LGTM.com new alerts:
|
|
Hmmm, it looks like the test failure occurs because |
OK, no idea why the test passes locally, but |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #670 +/- ##
==========================================
+ Coverage 81.27% 81.30% +0.02%
==========================================
Files 46 46
Lines 3968 3968
==========================================
+ Hits 3225 3226 +1
+ Misses 743 742 -1 ☔ View full report in Codecov by Sentry. |
|
Hey @rkingsbury, thanks for this PR!
I think I agree with this. Having the behavior consistent between the two appears to be less confusing to me as well.
I vote to make these functional here. I see your argument, but I feel as though including them will make using |
This is very strange, thanks for catching it. |
This PR began as an effort to fix #622 although has evolved based on what I learned. I've discovered a couple of inconsistencies related to
groupbybehavior and kwargs that I think we should rectify (see below). @munrojm what do you think is the best way to proceed here?behavior of
propertiesApparently the default behavior in MongoDB is that when
propertiesisNone,querywill return all fields in a document, butgroupbywill return nothing except the 'id' field. See this from the docsPersonally I think within
maggmait might make more sense to make the behavior consistent betweenqueryandgroupbysince not allmaggmausers will be intimately familiar with MongoDB conventions, but I'm not sure if we want to depart from what MongoDB does or not.sort,skip, andlimitkwargsA related point -
Store.groupbydefines thesort,skip, andlimitkwargs, but it is not clear whether those make sense in the context of a groupby operation. They don't appear to be arguments in pymongo / MongoDB aggregation and they don't appear to be functional anywhere withinmaggma. So I would advocate that we either make those kwargs functional (and consistent with their behavior inquery), or we remove them from the interface.Contributor Checklist
propertieskwarg inqueryandgroupbygroupbyfromMongoStoreinMemoryStoreMemoryStore.groupbytoMontyStore.groupbyb/cmontydbdoes not implement anaggregatemethod and therefore can't inherit fromMongoStore.groupbysort,skip, andlimitkwargs inMongoStore.querysort,skip, andlimitare non-functional