Amplitude-Python icon indicating copy to clipboard operation
Amplitude-Python copied to clipboard

test(event): Add test with `none` in event_properties

Open joystein opened this issue 2 years ago • 2 comments

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

joystein avatar Mar 01 '23 14:03 joystein

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'}

ethan-welysn avatar Jul 04 '23 05:07 ethan-welysn

I agree with that - it seems that canceling out all data in a event because one value is not set seems confusing - at best.

sheepsy90 avatar Oct 17 '23 09:10 sheepsy90