From 71664c8ac5c05aeb89da9ce86862dfdfb9616a3a Mon Sep 17 00:00:00 2001 From: Tim van Osch Date: Sat, 4 Nov 2023 16:14:20 +0100 Subject: [PATCH] Fix(userworkers): timestamp can only be int --- .../fission-user-workers/service/python/base.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/services/fission-user-workers/service/python/base.py b/services/fission-user-workers/service/python/base.py index 5480d278..03ceaf9a 100644 --- a/services/fission-user-workers/service/python/base.py +++ b/services/fission-user-workers/service/python/base.py @@ -52,14 +52,14 @@ def __init__(self, longitude: Optional[float] = None, altitude: Optional[float] = None, properties: Optional[Dict[str, Any]] = None): - self.timestamp = timestamp - self.sensor_external_id = sensor_external_id - self.value = value - self.observed_property = observed_property - self.unit_of_measurement = unit_of_measurement - self.latitude = latitude - self.longitude = longitude - self.altitude = altitude + self.timestamp = int(timestamp) + self.sensor_external_id = str(sensor_external_id) + self.value = float(value) + self.observed_property = str(observed_property) + self.unit_of_measurement = str(unit_of_measurement) + self.latitude = float(latitude) if latitude else None + self.longitude = float(longitude) if longitude else None + self.altitude = float(altitude) if altitude else None self.properties = properties if properties else {} def json_dict(self):