-
Notifications
You must be signed in to change notification settings - Fork 21
Add some more dtypes: Date, Datetime, Duration, String #197
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
Changes from 6 commits
07bb3d8
1d7682c
82bc5cb
3194335
f5c4e55
ed2dbbf
188a75f
a90e3fe
ea56e11
a96d9c4
1e09ea9
a28f210
e4f3e7f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
""" | ||
from __future__ import annotations | ||
|
||
from typing import Mapping, Sequence, Any | ||
from typing import Mapping, Sequence, Any, Literal | ||
|
||
from .column_object import * | ||
from .dataframe_object import DataFrame | ||
|
@@ -32,6 +32,9 @@ | |
"Float64", | ||
"Float32", | ||
"Bool", | ||
"Datetime", | ||
"Duration", | ||
"String", | ||
] | ||
|
||
|
||
|
@@ -238,4 +241,27 @@ class Float32: | |
"""Floating point type with 32 bits of precision.""" | ||
|
||
class Bool: | ||
"""Boolean type with 8 bits of precision.""" | ||
"""Boolean type.""" | ||
|
||
class Datetime: | ||
""" | ||
Datetime type. | ||
|
||
Attributes | ||
---------- | ||
time_unit : Literal['ms', 'us', 'ns'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having gone through some work in this area recently, nanosecond support isn't common in relational databases where for example DuckDB and Postgres do datetimes as number of microseconds (DuckDB Postgres). Going from microseconds upwards to milliseconds and seconds is generally more easily handled and straightforward, but going down to nanoseconds is not. Maybe we should consider punting on nanoseconds for the time being? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure |
||
Precision of the datetime type. There is no guarantee that the full | ||
range of dates available for the specified precision is supported. | ||
time_zone : str | None | ||
Time zone of the datetime type. Only IANA time zones are supported. | ||
`None` indicates time-zone-naive data. | ||
""" | ||
time_unit: Literal['ms', 'us', 'ns'] | ||
time_zone: str | None # Only IANA time zones are supported | ||
|
||
class Duration: | ||
"""Duration type.""" | ||
time_unit: Literal['ms', 'us', 'ns'] | ||
|
||
class String: | ||
"""String type.""" |
Uh oh!
There was an error while loading. Please reload this page.