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

tsio: add a predicate to check the existence of a serie (by name)

closes #9
parent aa5617b328ad
......@@ -146,6 +146,9 @@ def test_differential(engine):
ts_begin = genserie(datetime(2010, 1, 1), 'D', 10)
tso.insert(engine, ts_begin, 'ts_test', 'test')
assert tso.exists(engine, 'ts_test')
assert not tso.exists(engine, 'this_does_not_exist')
assert_df("""
2010-01-01 0.0
2010-01-02 1.0
......
......@@ -180,6 +180,9 @@ class TimeSerie(object):
group[seriename] = serie
return group
def exists(self, cn, name):
return self._get_ts_table(cn, name) is not None
def latest_insertion_date(self, cn, name):
cset = schema.changeset
tstable = self._get_ts_table(cn, name)
......
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