Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppress predicted_gender and predicted_age events #6

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

karlicoss
Copy link
Contributor

Started getting these in newer discord exports

they look like this in raw export

{'user_id': '605898501150343168', 'predicted_gender': 'male', 'probability': 0.9174297451972961, 'prob_male': 0.9174297451972961, 'prob_female': 0.07241026312112808, 'prob_non_binary_gender_expansive': 0.010159985162317753, 'model_version': '2023-03-08T00:00:00.000000Z',     'day_pt': '2023-03-15 00:00:00 UTC'}
{'user_id': '605898501150343168', 'predicted_age': '35+', 'probability': 0.503736138343811, 'prob_13_17': 0.1455467939376831, 'prob_18_24': 0.17453151941299438, 'prob_25_34': 0.17618557810783386, 'prob_35_over': 0.503736138343811, 'model_version': '2023-03-01T00:00:00.000    000Z', 'day_pt': '2023-03-08 00:00:00 UTC'}

causing parser to crash because they don't have any event id/type

perhaps even better would be to make everything a bit more defensive and yield Res[Activity], but probably worth skipping these anyway

they look like this in raw export

    {'user_id': '605898501150343168', 'predicted_gender': 'male', 'probability': 0.9174297451972961, 'prob_male': 0.9174297451972961, 'prob_female': 0.07241026312112808, 'prob_non_binary_gender_expansive': 0.010159985162317753, 'model_version': '2023-03-08T00:00:00.000000Z',     'day_pt': '2023-03-15 00:00:00 UTC'}
    {'user_id': '605898501150343168', 'predicted_age': '35+', 'probability': 0.503736138343811, 'prob_13_17': 0.1455467939376831, 'prob_18_24': 0.17453151941299438, 'prob_25_34': 0.17618557810783386, 'prob_35_over': 0.503736138343811, 'model_version': '2023-03-01T00:00:00.000    000Z', 'day_pt': '2023-03-08 00:00:00 UTC'}

causing parser to crash because they don't have any event id/type
@purarue
Copy link
Owner

purarue commented Apr 3, 2023

Looks good, thanks 👍

@purarue purarue merged commit 370c009 into purarue:master Apr 3, 2023
@karlicoss karlicoss deleted the fix-predicted-events branch April 3, 2023 22:00
@purarue
Copy link
Owner

purarue commented Apr 3, 2023

Published v0.1.2 to Pypi

@purarue purarue mentioned this pull request Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants