Commit dbeaff27 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

insertion_date: follow tshistory change

parent 49aa45863584
......@@ -281,7 +281,7 @@ def test_strip(engine, tsh):
ts = genserie(datetime(2019, 1, 1), 'D', 3)
tsh.insert(
engine, ts, 'strip-unsupervised', 'test',
_insertion_date=utcdt(2019, 1, 1)
insertion_date=utcdt(2019, 1, 1)
)
csid = tsh.changeset_at(engine, 'strip-unsupervised', utcdt(2019, 1, 1))
tsh.strip(engine, 'strip-unsupervised', csid)
......@@ -290,7 +290,7 @@ def test_strip(engine, tsh):
tsh.insert(
engine, ts, 'strip-handcrafted', 'test',
manual=True,
_insertion_date=utcdt(2019, 1, 1)
insertion_date=utcdt(2019, 1, 1)
)
csid = tsh.changeset_at(engine, 'strip-handcrafted', utcdt(2019, 1, 1))
tsh.strip(engine, 'strip-handcrafted', csid)
......@@ -298,13 +298,13 @@ def test_strip(engine, tsh):
ts = genserie(datetime(2019, 1, 1), 'D', 3)
tsh.insert(
engine, ts, 'strip-supervised', 'test',
_insertion_date=utcdt(2019, 1, 1)
insertion_date=utcdt(2019, 1, 1)
)
ts = genserie(datetime(2019, 1, 2), 'D', 3)
tsh.insert(
engine, ts, 'strip-supervised', 'test',
manual=True,
_insertion_date=utcdt(2019, 1, 2)
insertion_date=utcdt(2019, 1, 2)
)
with pytest.raises(ValueError) as err:
......
......@@ -76,13 +76,13 @@ class timeseries(basets):
@tx
def insert(self, cn, ts, name, author,
metadata=None,
_insertion_date=None, manual=False):
insertion_date=None, manual=False):
if not self.exists(cn, name):
# initial insert
diff = super().insert(
cn, ts, name, author,
metadata=metadata,
_insertion_date=_insertion_date
insertion_date=insertion_date
)
if diff is None:
return
......@@ -103,7 +103,7 @@ class timeseries(basets):
self.upstream.insert(
cn, current, name, author,
metadata=metadata,
_insertion_date=_insertion_date
insertion_date=insertion_date
)
# update supervision status
meta = self.metadata(cn, name)
......@@ -113,7 +113,7 @@ class timeseries(basets):
return super().insert(
cn, ts, name, author,
metadata=metadata,
_insertion_date=_insertion_date
insertion_date=insertion_date
)
assert supervision_status in ('supervised', 'handcrafted')
......@@ -124,7 +124,7 @@ class timeseries(basets):
diff = self.upstream.insert(
cn, ts, name, author,
metadata=metadata,
_insertion_date=_insertion_date
insertion_date=insertion_date
)
if supervision_status == 'handcrafted':
......@@ -140,7 +140,7 @@ class timeseries(basets):
a = super().insert(
cn, diff, name, author,
metadata=metadata,
_insertion_date=_insertion_date
insertion_date=insertion_date
)
return a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment