Skip to content

Commit

Permalink
remove add boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
vcai122 committed Sep 13, 2023
1 parent 2f47197 commit 097d582
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/penndata/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def get_usage(self, room, date, num_samples, group_by, field):
usage = self.get_usage_on_date(room, curr, field) # usage for curr
# incorporate usage safely considering None (no data) values
usage_aggs = [
(self.safe_add(sum, val), count + (val is not None))
(self.safe_add(sum, val), count + (1 if val is not None else 0))
for (sum, count), val in zip(usage_aggs, usage)
]
# update min and max date if any data was logged
Expand Down

0 comments on commit 097d582

Please sign in to comment.