-
Notifications
You must be signed in to change notification settings - Fork 32
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
Store.groupby enhancements #670
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
groupby
behavior and kwargs that I think we should rectify (see below). @munrojm what do you think is the best way to proceed here?behavior of
properties
Apparently the default behavior in MongoDB is that when
properties
isNone
,query
will return all fields in a document, butgroupby
will return nothing except the 'id' field. See this from the docsPersonally I think within
maggma
it might make more sense to make the behavior consistent betweenquery
andgroupby
since not allmaggma
users 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
, andlimit
kwargsA related point -
Store.groupby
defines thesort
,skip
, andlimit
kwargs, 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
properties
kwarg inquery
andgroupby
groupby
fromMongoStore
inMemoryStore
MemoryStore.groupby
toMontyStore.groupby
b/cmontydb
does not implement anaggregate
method and therefore can't inherit fromMongoStore.groupby
sort
,skip
, andlimit
kwargs inMongoStore.query
sort
,skip
, andlimit
are non-functional