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

tsio/get: fix snapshot lookup with a revdate in the past


We were missing a real table join. Nasty :/

Resolves #30.
parent fbf9eb15ed20
......@@ -505,15 +505,13 @@ def test_revision_date(engine, tsh):
2017-01-06 4.0
""", tsh.get(engine, 'revdate'))
bogus = tsh.get(engine, 'revdate', revision_date=datetime(2016, 1, 2))
oldstate = tsh.get(engine, 'revdate', revision_date=datetime(2016, 1, 2))
assert_df("""
2017-01-01 1.0
2017-01-02 2.0
2017-01-03 3.0
2017-01-04 4.0
2017-01-05 4.0
2017-01-06 4.0
""", bogus) # oops, looks like we didn't pick the right data
2017-01-03 2.0
2017-01-04 2.0
""", oldstate)
tsh._snapshot_interval = ival
......
......@@ -542,7 +542,8 @@ class TimeSerie(object):
sql = select([table.c.id, table.c[column]]
).order_by(desc(table.c.id)
).limit(1
).where(table.c[column] != None)
).where(table.c[column] != None
).select_from(table.join(cset))
if qfilter:
sql = sql.where(table.c.csid <= cset.c.id)
......
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