Make transaction.meter_end required and force tz utc for all datetimes
This commit is contained in:
parent
4272f2878e
commit
8e42205301
8 changed files with 32 additions and 10 deletions
|
@ -1,3 +1,4 @@
|
|||
from datetime import datetime, timezone
|
||||
from decimal import Decimal
|
||||
from typing import Union
|
||||
|
||||
|
@ -19,4 +20,8 @@ def decimal_encoder(dec_value: Decimal) -> Union[int, float]:
|
|||
if isinstance(exponent, int) and exponent >= 0:
|
||||
return int(dec_value)
|
||||
else:
|
||||
return float(dec_value)
|
||||
return float(dec_value)
|
||||
|
||||
def force_utc_datetime(datetime_value: datetime) -> datetime:
|
||||
"""Force a datetime to be in the UTC timzone"""
|
||||
return datetime_value.replace(tzinfo=timezone.utc)
|
Loading…
Add table
Add a link
Reference in a new issue