waggle-sensor / pywaggle

Python SDK for integrating plugins with Waggle.
Other
6 stars 8 forks source link

[Sage-1301] Added type and minimum value check for timestamps. #30

Closed seanshahkarami closed 2 years ago

seanshahkarami commented 2 years ago

This PR added type and approximate unit checking for publish timestamps. Specifically it does:

Step 1. Check if timestamp is int. Step 2. Check if timestamp is after 2000-01-01 00:00:00 UTC in nanoseconds since epochs.

Step 1 is intended to catch accidental uses of time.time() or arithmetic errors like:

timestamp = get_timestamp() + skip_second * 1e9

Step 2 is intended to approximately catch accidental uses of second based timestamps.