Skip to content

Commit

Permalink
Solves select with multiple columns from df. (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
juan cañete committed Nov 6, 2017
1 parent 73dfdcd commit 789258c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/komlogd/api/model/store.py
Expand Up @@ -240,7 +240,7 @@ def _get_metric_data(self, metric, its, ets, count):
df = self._dfs.get(metric, None)
have_df, have_tr_df = isinstance(df, pd.DataFrame), isinstance(tr_df, pd.DataFrame)
if have_df and have_tr_df:
df = df[df.t.between(its,ets)][df.index<=tr.tm][['t','value']]
df = df[(df.index<=tr.tm) & (df.t.between(its,ets))][['t','value']]
tr_df = tr_df[tr_df.t.between(its,ets)][['t','value']]
# in concat, tr_df at the end, because its index will always be higher. No need to sort it.
join_df = pd.concat([df,tr_df])
Expand Down

0 comments on commit 789258c

Please sign in to comment.