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

namespaces: make sure the `automatic` and `manual` namespaces are properly...

namespaces: make sure the `automatic` and `manual` namespaces are properly related to the base namespace
parent cbab2faa20f2
......@@ -20,12 +20,12 @@ def engine(request):
meta = MetaData()
with e.connect() as cn:
reset(cn)
delete_schema(e, 'automatic')
delete_schema(e, 'manual')
delete_schema(e, 'tsh-automatic')
delete_schema(e, 'tsh-manual')
with e.connect() as cn:
init(cn, meta)
init(cn, meta, 'automatic')
init(cn, meta, 'manual')
init(cn, meta, 'tsh-automatic')
init(cn, meta, 'tsh-manual')
yield e
......
......@@ -415,7 +415,7 @@ def test_more_manual(engine, tsh):
2015-01-05 True
""", marker)
tshm = TimeSerie('manual')
tshm = TimeSerie('tsh-manual')
man = tshm.get(engine, 'ts_exp1', _keep_nans=True)
assert_df("""
2015-01-03 -3.0
......
......@@ -54,7 +54,7 @@ class TimeSerie(BaseTS):
def insert(self, cn, ts, name, author, _insertion_date=None, manual=False):
if manual:
basetsh = BaseTS(namespace='manual')
basetsh = BaseTS(namespace='{}-manual'.format(self.namespace))
# insert & compute diff over synthetic
diff = basetsh.insert(
cn, ts, name, author, _insertion_date=_insertion_date
......@@ -66,7 +66,7 @@ class TimeSerie(BaseTS):
else:
# insert into synthetic & compute diff over automatic
basetsh = BaseTS(namespace='automatic')
basetsh = BaseTS(namespace='{}-automatic'.format(self.namespace))
diff = basetsh.insert(
cn, ts, name, author,
_insertion_date=_insertion_date
......@@ -89,7 +89,7 @@ class TimeSerie(BaseTS):
if table is None:
return None, None
autotsh = BaseTS(namespace='automatic')
autotsh = BaseTS(namespace='{}-automatic'.format(self.namespace))
auto = autotsh.get(cn, name,
revision_date=revision_date,
from_value_date=from_value_date,
......
Supports Markdown
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