Skip to content

Commit

Permalink
Skip sensors with no samples, otherwise keyerror, also remove extreme…
Browse files Browse the repository at this point in the history
… logging
  • Loading branch information
alneberg committed Oct 26, 2021
1 parent dd222f4 commit e5d8cdc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sensorpush_to_statusdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ def process_data(sensors_json, samples_json, start_time, nr_samples_requested):

sensor_documents = []
for sensor_id, sensor_info in sensors_json.items():
# Check if any samples available for the sensor
if sensor_id not in df.columns:
continue

sensor_limit_lower, sensor_limit_upper = sensor_limits(sensor_info)
if (sensor_limit_lower is None) and (sensor_limit_upper is None):
logger.warning(
Expand Down Expand Up @@ -331,7 +335,6 @@ def main(
nr_samples_requested, startTime=start_time, stopTime=end_time
)

logging.info(f"(Samples found: {samples}")
# Summarize data and put into documents suitable for upload
sensor_documents = process_data(
sensors, samples, start_date_datetime, nr_samples_requested
Expand Down

0 comments on commit e5d8cdc

Please sign in to comment.