Skip to content

Commit

Permalink
catch empty DataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
JrtPec committed Nov 27, 2019
1 parent 3b9bd95 commit 35bce65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cloogy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .tag import Tag

__title__ = "cloogy"
__version__ = "0.0.2"
__version__ = "0.0.3"
__author__ = "EnergieID.be"
__license__ = "MIT"

Expand Down Expand Up @@ -310,6 +310,8 @@ def get_readings_dataframe(self, granularity, tags, start, end, instants_type=No
end=end,
instants_type=instants_type
)
if df.empty:
return df
df.set_index(['TagId', 'Date'], inplace=True)
df = df[metric].unstack().T
df.index.name = None
Expand Down

0 comments on commit 35bce65

Please sign in to comment.