Commit 97fd0e1
authored
Apply 5.0 deprecation and renaming to
This makes the module more robust as it models sub-second precision with ints
instead of floats. This finishes off the work started in PR #551.
Breaking changes:
- `Duration`
- The constructor does not accept `subseconds` anymore.
Use `milliseconds`, `microseconds`, or `nanoseconds` instead.
- The property `subseconds` has been removed.
Use `nanoseconds` instead.
- The property `hours_minutes_seconds` has been removed.
Use `hours_minutes_seconds_nanoseconds` instead.
- For all math operations holds: they are element-wise on
(`months`, `days`, `nanoseconds`).
This affects (i.e., changes) the working of `//`, `%`, `/`, and `*`.
- Years are equal to 12 months.
- Weeks are equal to 7 days.
- `seconds`, `milliseconds`, `microseconds`, and `nanoseconds` are
implicitly converted to `nanoseconds` or `seconds` as fit.
- Multiplication and division allow for floats but will always result in
integer values (round to nearest even).
- `Time`
- The constructor does not accept `float`s for `second` anymore.
Use `nanosecond` instead.
- Ticks are now nanoseconds since midnight (`int`).
- The property `ticks_ns` has been renamed to `ticks`.
The old `ticks` is no longer supported.
- The property`from_ticks_ns` has been renamed to `from_ticks`.
The old `from_ticks` is no longer supported.
- The property `second` returns an `int` instead of a `float`.
Use `nanosecond` to get the sub-second information.
- The property `hour_minute_second` has been removed.
Use `hour_minute_second_nanosecond` instead.
- `DateTime`
- The property `hour_minute_second` has been removed.
Use `hour_minute_second_nanosecond` instead.
- The property `second` returns an `int` instead of a `float`.
Use `nanosecond` to get the sub-second information.neo4j.time module. (#635)1 parent 19ad25b commit 97fd0e1
File tree
9 files changed
+355
-395
lines changed- docs/source
- neo4j/time
- tests
- integration
- unit/common/time
9 files changed
+355
-395
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
18 | 53 | | |
19 | 54 | | |
20 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | 145 | | |
148 | 146 | | |
149 | 147 | | |
| |||
164 | 162 | | |
165 | 163 | | |
166 | 164 | | |
167 | | - | |
168 | | - | |
169 | 165 | | |
170 | 166 | | |
171 | 167 | | |
172 | 168 | | |
173 | 169 | | |
174 | 170 | | |
175 | | - | |
| 171 | + | |
176 | 172 | | |
177 | 173 | | |
178 | 174 | | |
| |||
290 | 286 | | |
291 | 287 | | |
292 | 288 | | |
293 | | - | |
294 | | - | |
295 | 289 | | |
296 | 290 | | |
297 | 291 | | |
| |||
388 | 382 | | |
389 | 383 | | |
390 | 384 | | |
391 | | - | |
392 | | - | |
393 | 385 | | |
394 | 386 | | |
395 | 387 | | |
396 | 388 | | |
397 | | - | |
398 | | - | |
399 | 389 | | |
400 | 390 | | |
401 | 391 | | |
| |||
410 | 400 | | |
411 | 401 | | |
412 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
413 | 411 | | |
414 | 412 | | |
415 | 413 | | |
| |||
0 commit comments