You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When sending an event via amplitude.track with a dictionary of event properties where one value might be None, expect that the None value is either serialized to null or deleted.
Current Behavior
If any value within a dictionary is None, no event properties are sent. I suspect this is also an issue for user_properties and group_properties, though have not verified. Per the object validation method, a None value would cause the entire object to fail.
Possible Solution
Add None type to the list of valid values and let the object serialize it to null. This can then be filtered out appropriately in charts or addressed in code if it's an incorrect value.
Steps to Reproduce
okay_event=BaseEvent(
event_type='test event',
user_id='12345',
event_properties={'requiredProp': 'this is never null', 'optionalProp': 'this is sometimes null'},
)
okay_event.get_event_body()
# {'user_id': '12345', 'event_type': 'test event', 'event_properties': {'requiredProp': 'this is never null', 'optionalProp': 'this is sometimes null'}}fail_event=BaseEvent(
event_type='test event',
user_id='12345',
event_properties={'requiredProp': 'this is never null', 'optionalProp': None},
)
fail_event.get_event_body()
# {'user_id': '12345', 'event_type': 'test event'}
Environment
SDK Version: 1.1.3
Python Version: 3.11
OS Info: Ubuntu 20.04
The text was updated successfully, but these errors were encountered:
Expected Behavior
When sending an event via
amplitude.track
with a dictionary of event properties where one value might beNone
, expect that theNone
value is either serialized tonull
or deleted.Current Behavior
If any value within a dictionary is
None
, no event properties are sent. I suspect this is also an issue foruser_properties
andgroup_properties
, though have not verified. Per the object validation method, aNone
value would cause the entire object to fail.Possible Solution
Add
None
type to the list of valid values and let the object serialize it tonull
. This can then be filtered out appropriately in charts or addressed in code if it's an incorrect value.Steps to Reproduce
Environment
The text was updated successfully, but these errors were encountered: