-
Notifications
You must be signed in to change notification settings - Fork 31
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
Enable recursive_msonable
in jsanitize
calls
#930
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #930 +/- ##
=======================================
Coverage 81.52% 81.52%
=======================================
Files 46 46
Lines 3940 3940
=======================================
Hits 3212 3212
Misses 728 728 ☔ View full report in Codecov by Sentry. |
recursive_msonable
in jsanitize
callsrecursive_msonable
in jsanitize
calls
This makes sense to me @Andrew-S-Rosen . I'm guessing it has not come up before because the For context I'm linking here the current source of
So yeah, I don't see any reason not to enable |
Ah, I see. I suppose that makes sense. I have always just passed it a
@rkingsbury: I believe your understanding is almost correct. For
Great. Would love to get @munrojm's confirmation. 👍 |
Ah yes, I see now. Thanks for the clarification (I updated my previous post to strikethrough the incorrect info) |
This would also be useful for my use case! |
Sorry, this is just getting on my radar again. No issues on my end, this all sounds good @rkingsbury. |
Thanks @munrojm . I'm trying to merge but GitHub is acting weird - have you ever seen this? Anyway, feel free to merge if you are able to before I sort this out. |
I have seen this happen. I usually just wait a few minutes and try again. |
After multiple tries over ~ 2 hours, it's still happening. Maybe someone else can try? |
I don't have permissions, but perhaps you can just do a straight merge into |
Thanks @Andrew-S-Rosen ! |
Summary
In several places throughout
maggma
, themonty.json.jsanitize
function is called to (as the name suggests) sanitize the data prior to dumping it in theStore
. This is all fine and dandy, butMSONable
objects are (seemingly?) converted tostr
. Withrecursive_msonable=True
, allMSONable
objects are converted to JSONable dictionary form via.as_dict()
.@rkingsbury, @munrojm: I'm assuming there's something I'm missing here. Apologies because I don't have a MongoDB set up anymore so can't test directly, but surely we want
MSONable
objects to be represented in.as_dict()
form in the data store, right? Is that happening some other way?