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

rename: properly handle the renaming

parent e04c1b90cae7
......@@ -46,6 +46,18 @@ def test_mercure_serie(engine, tsh):
""", pd.read_sql('select * from tsh.changeset_series', engine))
def test_rename(engine, tsh):
tsh.insert(engine, genserie(datetime(2010, 1, 1), 'D', 3),
'rename-me', 'Babar')
tsh.rename(engine, 'rename-me', 'renamed')
tsh._resetcaches()
assert tsh.get(engine, 'rename-me') is None
assert tsh.get(engine, 'renamed') is not None
assert tsh.upstream.get(engine, 'rename-me') is None
assert tsh.upstream.get(engine, 'renamed') is not None
def test_non_monotonic_autodiff(engine, tsh):
s1 = pd.Series([1, 3], index=[utcdt(2018, 1, 1), utcdt(2018, 1, 3)])
s2 = pd.Series([2, 3.1], index=[utcdt(2018, 1, 2), utcdt(2018, 1, 3)])
......
......@@ -86,6 +86,11 @@ class timeseries(basets):
super().delete(cn, seriename)
self.upstream.delete(cn, seriename)
@tx
def rename(self, cn, oldname, newname):
super().rename(cn, oldname, newname)
self.upstream.rename(cn, oldname, newname)
# supervision specific API
@tx
......
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