Skip to content

Commit 2f1293f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 07923f8 commit 2f1293f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ipyparallel/controller/mongodb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@
1111
except ImportError:
1212
from bson import Binary
1313

14+
from datetime import datetime, timezone
15+
1416
from traitlets import Dict, Instance, List, Unicode
1517

1618
from .dictdb import BaseDB
17-
from datetime import datetime, timezone
1819

1920
# we need to determine the pymongo version because of API changes. see
2021
# https://pymongo.readthedocs.io/en/stable/migrate-to-pymongo4.html
@@ -25,11 +26,13 @@
2526
# MongoDB class
2627
# -----------------------------------------------------------------------------
2728

29+
2830
def _ensure_utc(obj):
2931
if isinstance(obj, datetime):
3032
obj = obj.replace(tzinfo=timezone.utc)
3133
return obj
3234

35+
3336
def _ensure_utc_for_record(rec):
3437
for key in ('submitted', 'started', 'completed', 'received'):
3538
if key in rec:

0 commit comments

Comments
 (0)