Skip to content

fix(types): handle when self.username is None - #201

Closed
PrinceBunBun981 wants to merge 2 commits into
reconurge:mainfrom
PrinceBunBun981:fix/types/social_account
Closed

fix(types): handle when self.username is None#201
PrinceBunBun981 wants to merge 2 commits into
reconurge:mainfrom
PrinceBunBun981:fix/types/social_account

Conversation

@PrinceBunBun981

Copy link
Copy Markdown

Fixes an issue where running an enricher (like Maigret) on a Username finds accounts, but self.username in social_account.py was None; adds additional checks for self.username and a fallback for self.id.

Related traceback: Hastebin

@dextmorgn

dextmorgn commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Hey @PrinceBunBun981,

Thanks for this patch.

There is a failing test covering this case in the CI :

=================================== FAILURES ===================================
________________ test_social_account_label_without_display_name ________________

    def test_social_account_label_without_display_name():
        username = Username(value="johndoe")
        account = SocialAccount(username=username, platform="twitter")
>       assert account.nodeLabel == "johndoe@twitter"
E       AssertionError: assert '@johndoe' == 'johndoe@twitter'
E         
E         - johndoe@twitter
E         + @johndoe

tests/test_labels.py:155: AssertionError
=========================== short test summary info ============================
FAILED tests/test_labels.py::test_social_account_label_without_display_name - AssertionError: assert '@johndoe' == 'johndoe@twitter'
  
  - johndoe@twitter
  + @johndoe
========================= 1 failed, 53 passed in 0.69s =========================
make: *** [Makefile:140: test] Error 1

Could you fix it as well ?

Good catch anyway !

@PrinceBunBun981

Copy link
Copy Markdown
Author

Yep, my mistake; should've run the tests before submitting the PR.

@dextmorgn

Copy link
Copy Markdown
Collaborator

You can also feel free to update the tests to fit the new format ;)

@PrinceBunBun981

Copy link
Copy Markdown
Author

True, however, since the current format has worked for IDs and nodeLabel so far, would rather keep it as is :)

@PrinceBunBun981

Copy link
Copy Markdown
Author

Superseded by #206.

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