Commit 49b1634
authored
feat: teach TemporalMetadata about its relationship to DTypes (#5864)
I discovered this implicit mapping from TemporalMetadata to DType by
trial-and-error and looking at arrays/datetime/mod.rs. AFAIK, this
relationship between temporal type and bitwidth comes from [the arrow
specification](https://github.com/apache/arrow/blob/7151dcd6faa6a507d99b33ecc797f3d6a74f45ae/format/Schema.fbs#L246-L277).
For arrays, TemporalArray already addresses these issues [1], but for
Vortex users who create or manipulate scalars, these methods are
valuable.
[1] Insofar as temporal array expects you to give it a valid PType (it
panics if the width is
wrong) but will construct the extension DType for you.
---------
Signed-off-by: Daniel King <[email protected]>1 parent 6a9f07a commit 49b1634
1 file changed
+57
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
120 | 123 | | |
121 | 124 | | |
122 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
123 | 180 | | |
124 | 181 | | |
125 | 182 | | |
| |||
0 commit comments