Skip to content

Commit

Permalink
Merge pull request #67 from julffers/develop
Browse files Browse the repository at this point in the history
fixed usage of compressed timeseries in multi_get_ts_from_db
  • Loading branch information
julffers authored Nov 19, 2024
2 parents 45678fe + 2e60340 commit 80353cc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pandahub/lib/PandaHub.py
Original file line number Diff line number Diff line change
Expand Up @@ -2674,15 +2674,18 @@ def multi_get_timeseries_from_db(
}
pipeline.append({"$project": projection})
if not include_metadata:
pipeline.append({"$project": {"timeseries_data": 1}})
if compressed_ts_data:
pipeline.append({"$project": {"timeseries_data": 1, "num_timestamps": 1}})
else:
pipeline.append({"$project": {"timeseries_data": 1}})

timeseries = []
for ts in db[collection_name].aggregate(pipeline):
if len(ts["timeseries_data"]) == 0:
continue
data = ts["timeseries_data"]
if compressed_ts_data:
timeseries_data = decompress_timeseries_data(data, ts_format)
timeseries_data = decompress_timeseries_data(data, ts_format, ts["num_timestamps"])
ts["timeseries_data"] = timeseries_data
else:
if ts_format == "timestamp_value":
Expand Down

0 comments on commit 80353cc

Please sign in to comment.