diff --git a/pandahub/lib/PandaHub.py b/pandahub/lib/PandaHub.py index 3a80d6a..c2e0f02 100644 --- a/pandahub/lib/PandaHub.py +++ b/pandahub/lib/PandaHub.py @@ -2674,7 +2674,10 @@ 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): @@ -2682,7 +2685,7 @@ def multi_get_timeseries_from_db( 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":