Skip to content
Snippets Groups Projects
Verified Commit 0475f981 authored by David Hoese's avatar David Hoese
Browse files

Remove deprecated pandas datetime usage

parent b331cefd
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ import logging.handlers ...@@ -4,7 +4,7 @@ import logging.handlers
import sys import sys
import time import time
from collections.abc import Iterable from collections.abc import Iterable
from datetime import timedelta from datetime import datetime, timedelta
from pathlib import Path from pathlib import Path
from urllib.parse import urlencode from urllib.parse import urlencode
...@@ -90,7 +90,7 @@ class Updater: ...@@ -90,7 +90,7 @@ class Updater:
# current minute was 13 and the submit interval was 5 minutes, then data would be submitted at 18, 23, 28, # current minute was 13 and the submit interval was 5 minutes, then data would be submitted at 18, 23, 28,
# etc. If data collection went down and the next recorded current minute was 14, then data would be submitted # etc. If data collection went down and the next recorded current minute was 14, then data would be submitted
# at 19, 24, 29, etc (inconsistent). # at 19, 24, 29, etc (inconsistent).
reference = pd.datetime(record["timestamp"].year, 1, 1) reference = datetime(record["timestamp"].year, 1, 1)
progress = (record["timestamp"] - reference).total_seconds() % self.submit_interval progress = (record["timestamp"] - reference).total_seconds() % self.submit_interval
# If data hits or will pass over a submit_interval interval, return data. # If data hits or will pass over a submit_interval interval, return data.
if progress == 0 or progress > self.submit_interval - self.data_interval: if progress == 0 or progress > self.submit_interval - self.data_interval:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment