Amplitude-Python
Amplitude-Python copied to clipboard
test(event): Add test with `none` in event_properties
Summary
Adds a test which have none as one of the values in the dict given to event_properties of a BaseEvent. This test fails, while I wouldn't necessarily expect that. Is this a bug?
Checklist
- [x] Does your PR title have the correct title format?
- Does your PR have a breaking change?: no
I can confirm that attempting to create an event with event_properties= {"some_key": None}
will result in an event with event_properties being equal to None. This feels like a bug to me.
event = BaseEvent(
event_type="test_event",
user_id="test_user",
event_properties={'foo': 'bar', 'baz': None}
)
print(event.event_properties) ---> None
print(event.get_event_body()) ---> {'event_type': 'test_event'}
I agree with that - it seems that canceling out all data in a event because one value is not set seems confusing - at best.