Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pony
tshistory_supervision
Commits
d0c556923591
Commit
dbeaff27
authored
Aug 21, 2019
by
Aurélien Campéas
Browse files
insertion_date: follow tshistory change
parent
49aa45863584
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/test_supervision.py
View file @
d0c55692
...
...
@@ -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
:
...
...
tshistory_supervision/tsio.py
View file @
d0c55692
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment