feat: Handle numeric values in event properties

This commit is contained in:
Paul Gauthier (aider) 2024-08-12 16:16:39 -07:00
parent 6ec4e60058
commit 62a5cf8dee

View file

@ -36,5 +36,13 @@ class Analytics:
if properties is None:
properties = {}
properties.update(kwargs)
# Handle numeric values
for key, value in properties.items():
if isinstance(value, (int, float)):
properties[key] = value
else:
properties[key] = str(value)
properties["aider_version"] = __version__
self.mp.track(self.user_id, event_name, properties)