From e9b15737018ed476008223b1cdb3761a8abcbfd2 Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Tue, 2 Apr 2024 12:38:35 +0200 Subject: [PATCH] Fix internal usage of deprecated and imprecise Duration constructor --- neo4j/time/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neo4j/time/__init__.py b/neo4j/time/__init__.py index 7f13e3a2b..f41dab441 100644 --- a/neo4j/time/__init__.py +++ b/neo4j/time/__init__.py @@ -515,9 +515,10 @@ def __mod__(self, other): # ) seconds = self[2] + Decimal(self[3]) / NANO_SECONDS seconds, subseconds = symmetric_divmod(seconds % other, 1) + ns = subseconds * NANO_SECONDS return Duration(months=round_half_to_even(self[0] % other), days=round_half_to_even(self[1] % other), - seconds=seconds, subseconds=subseconds) + seconds=seconds, nanoseconds=ns) return NotImplemented @deprecated("Will be removed in 5.0.")