-
Notifications
You must be signed in to change notification settings - Fork 20
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
Allow numeric datetime time index #282
Conversation
Codecov Report
@@ Coverage Diff @@
## main #282 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 2508 2518 +10
=========================================
+ Hits 2508 2518 +10
Continue to review full report at Codecov.
|
assert dt.time_index == 'ints' | ||
assert dt.to_pandas()['ints'].dtype == 'datetime64[ns]' | ||
|
||
dt = DataTable(df, logical_types={'ints': 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.
Not sure if this was intentional, but at this point, dt['ints'] will be a bunch of datetime values, no longer integers.
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.
It look like this:
ints strs
0 1970-01-01 00:00:00.000000001 1
1 1970-01-01 00:00:00.000000002 2
2 1970-01-01 00:00:00.000000003 3
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.
hmm fair point. The issue we're fixing here only shows up on init, but I was thinking it would be nice to have a test of the numeric datetimes column being set to the time index after creation, though it's no longer numerics. I see how it doesn't really add anything, though
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.
Yah if it doesn't add anything, lets remove the additional lines.
assert dt.to_pandas()['ints'].dtype == 'datetime64[ns]' | ||
|
||
dt = DataTable(df, logical_types={'ints': Datetime}) | ||
dt = dt.set_time_index('ints') |
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.
What are we trying to check here? If you can set a time index after creation?
closes #275
We want to allow time indices to be made upon datatable init for columns such as
[1,2,3]
with the specified logical typeDatetime
.