-
Notifications
You must be signed in to change notification settings - Fork 208
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
🐛 FIX: REST API date-time query #4959
🐛 FIX: REST API date-time query #4959
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4959 +/- ##
===========================================
+ Coverage 80.17% 80.23% +0.06%
===========================================
Files 515 515
Lines 36741 36746 +5
===========================================
+ Hits 29454 29478 +24
+ Misses 7287 7268 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @NinadBhat!
The fix looks fine, I think though it would be good to also add a test in tests/restapi/test_routes.py:RESTApiTestSuite
, with an mtime
/ctime
filter on nodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some questions from my view:
- We already know the
DatetimePrecision
has adatatime
and anint
as its objects, then is there any particular reason that you dispatch it to return like aabc.Sequence
instead of dispatch it likenumbers.Complex
which also defined by two auguments. - I would suggest moving the
DatatimePrecision
definition fromaiida.restapi.common.utils
toaiida.common
. Sinceaiida.common
is a more 'internal' module thenaiida.restapi
. or maybe can put new code inaiida.restapi.common.utils
and leaveaiida.common
untouched? - I believe would be also good to add test in
tests/common/test_hashing.py
.
just look into the |
@chrisjsewell, the one test failing is because docker does not install flask. Not sure where I should add flask dependency for it to be installed with docker. |
From my point of view, I think this is a side effect that I mentioned, where you import |
@unkcpz makes sense. Thanks for the quick reply. @chrisjsewell should I move |
Yeh I don't think that is a problem; it is a very simple class with no dependencies
meh, I'm not too bothered either (particularly as we are likely going to scrap all the current restapi code soon 😆). It would actually be kind of nice to know where/why it is actually being hashed in the first place; from a quick look in the code, this was not immediately apparent (but don't worry about spending too long on this)
yeh always happy to use pytest-regression 👍 , although I don't think its a test dependency yet so yeh wouldn't add it in this PR |
Fixes #4957
Added hashing function for DatetimePrecision object.
@chrisjsewell Not sure if this is entirely right, but this method solved the error for me.