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

fix error with description #51

Merged
merged 2 commits into from
Sep 26, 2023
Merged

fix error with description #51

merged 2 commits into from
Sep 26, 2023

Conversation

issamansur
Copy link
Contributor

fix #50
Changes:

  • add field/key description for repositories with empty description
  • add type for variable innersource_repo

@zkoppert
Copy link
Owner

Thanks for working on this! A couple of issues I ran into when testing this:

Traceback (most recent call last):
  File "/Users/zkoppert/repos/innersource-crawler/./crawler.py", line 84, in <module>
    innersource_repo.set_default('description', '')
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict' object has no attribute 'set_default'. Did you mean: 'setdefault'?

and so I changed set_default to setdefault and ran again. At that point I am still receiving the following:

Traceback (most recent call last):
  File "/Users/zkoppert/repos/innersource-crawler/./crawler.py", line 87, in <module>
    innersource_repo["score"] = repo_activity.score.calculate(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/repo_activity/score.py", line 54, in calculate
    len(repo["description"]) > 30
    ^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()

Reading that error more carefully than I did before, I see that this is actually a failure in the dependency (repo_activity_score) The line the error references is here: https://github.com/InnerSourceCommons/repo-activity-score/blob/main/src/repo_activity/score.py#L54 and I believe that should be changed to see if repo["description"] = "" or something like that.

Would you like to make that change on that repo or would you prefer I did that? @issamansur

@issamansur
Copy link
Contributor Author

I saw that problem in dependency, but I thought that simple method set_default from class dict must to solve this problem elegantly. But I do mistake(
I can try to change this, but u are leader there)

@issamansur
Copy link
Contributor Author

Done! Try to test this

@zkoppert
Copy link
Owner

That worked!!! Thank you for working that out! 🎉

Copy link
Owner

@zkoppert zkoppert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@zkoppert zkoppert merged commit bc9b1f6 into zkoppert:main Sep 26, 2023
5 checks passed
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.

repositories with no description cause an error
2 participants