@@ -55,12 +55,10 @@ def insert(self, cn, newts, name, author,
55
55
author: str free-form author name
56
56
metadata: optional dict for changeset metadata
57
57
"""
58
- assert isinstance (name , str ), 'Name not a string'
59
- assert isinstance (author , str ), 'Author not a string'
60
- assert metadata is None or isinstance (metadata , dict ), 'Bad format for metadata'
61
- assert (_insertion_date is None or
62
- isinstance (_insertion_date , datetime )), 'Bad format for insertion date'
63
- newts = self ._guard_insert (newts )
58
+ newts = self ._guard_insert (
59
+ newts , name , author , metadata ,
60
+ _insertion_date
61
+ )
64
62
if not len (newts ):
65
63
return
66
64
@@ -434,7 +432,12 @@ def interval(self, cn, name, notz=False):
434
432
435
433
# creation / update
436
434
437
- def _guard_insert (self , newts ):
435
+ def _guard_insert (self , newts , name , author , metadata , insertion_date ):
436
+ assert isinstance (name , str ), 'Name not a string'
437
+ assert isinstance (author , str ), 'Author not a string'
438
+ assert metadata is None or isinstance (metadata , dict ), 'Bad format for metadata'
439
+ assert (insertion_date is None or
440
+ isinstance (insertion_date , datetime )), 'Bad format for insertion date'
438
441
assert isinstance (newts , pd .Series ), 'Not a pd.Series'
439
442
assert not newts .index .duplicated ().any (), 'There are some duplicates in the index'
440
443
0 commit comments