-
Notifications
You must be signed in to change notification settings - Fork 27
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
add last_updated_time_in_index
to retrieve_dataframe
#1846
add last_updated_time_in_index
to retrieve_dataframe
#1846
Conversation
…ch makes index into multi-index. Also updated docstring
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1846 +/- ##
=======================================
Coverage 91.05% 91.06%
=======================================
Files 124 124
Lines 19245 19247 +2
=======================================
+ Hits 17524 17527 +3
+ Misses 1721 1720 -1
|
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.
LGTM! Let's add a test making sure it works when len(rows)
is 0, 1, and many 👌
Where would be best to add the test? tests_unit/test_api/test_raw.py? |
Yup! |
cognite/client/_api/raw.py
Outdated
idx = pd.MultiIndex.from_tuples( | ||
[(r.key, r.last_updated_time) for r in rows], names=["key", "last_updated_time"] | ||
) |
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.
Should we convert epoch-ms to datetime?
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.
Good questions, I don't see why not.
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.
LGTM! Might need to update one or more tests after making it a timestamp? Also, please try to revert the unrelated docstring changes (unless you actually fixed something in them 👌 )
last_updated_time_in_index
to retrieve_dataframe
Description
Adding last_updated_time_in_index to retrieve_dataframe function, which makes index into multi-index. Also updated docstring.
Checklist:
If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.