mixpanel-utils icon indicating copy to clipboard operation
mixpanel-utils copied to clipboard

New Feature Request: Allow special character for delimiter when reading CSV files

Open asokratis opened this issue 2 years ago • 0 comments

https://github.com/mixpanel/mixpanel-utils/blob/61185dea3e7d125ee1f3edc94054950e293fa30c/init.py#L1751

change it to

reader = csv.reader(item_file, delimiter=delimiter_character)

The comma by default is not a very strong delimiter especially with how cloud databases export these data in a dirty way.

Ideally, I would want to pass the delimiter character as a parameter when I use the import_events function.

m.import_events('mixpanel_uploads/test_file.csv',timezone_offset=0, delimiter_character='\x1f')

As a short term workaround, I tried to override the class and function of _list_from_items_filename to apply the changes and it did not work (is it because it is a @staticmethod?), so I had to edit the actual source code of the library I installed in the end and that seemed to do the fix.

asokratis avatar Nov 10 '22 08:11 asokratis