In the last week, the annual event called Hacktoberfest was mentioned many times in the Utopian Discord server. It was talked about both by people who simply stumbled upon the topic and those who participated in the previous years. So I thought I should give it a try as well. After all, there's no better place than Utopian to care about events such as this one.
While working on my mini project, where I use Beem by @holger80, I've been reading the documentation and experimenting with different methods and classes which I needed for retrieving the discussions (aka posts and comments) from the Steem blockchain. During this time, I faced a minor issue. Because Beem has been easy to use, I did not feel that I would be lost in the documentation and the code. Therefore, the issue was not really critical, as it was simple to walk around it.
Anyway, Beem covers all methods for retrieving the discussions from the blockchain. On top of it, there is a wrapping method for all these individual methods/classes for getting the discussions in the Discussions class called get_discussions
.
You may notice that the input parameters were incorrect, which made the get_discussions
method unusable if you chose the author_before_date mode. As I said, not a critical issue because you can simply call the original method instead, with the correct parameters. However, I would say it was inconvenient, to say the least.
Unlike other classes, Discussions_by_author_before_date
takes different parameters and I would even say that it is an outsider amongst them, thus introducing more complexity when one creates a wrapper.
First, I submitted an issue in the GitHub repository. It did not get attention for a few days, so I decided to work on the fix myself.
Extending the Query class was the easiest and most straightforward solution I could see. It was needed because the class did not include all needed parameters. The parameters author and before_date were missing. Even though the author attribute could be potentially handled by the attribute tag - it would not be the first case with such use - adding a separate attribute for this case seemed more reasonable. However, before_date had to be added anyway.
By making this simple fix, the docstring had to be changed as well. Holger merged the PR shortly as he did not find any issue with the implementation and included in the latest release 0.20.6.
So why did I include Hacktoberfest in the title? Well, the event has been running since the beginning of the month and supports all contributors to open source projects. You can win a T-shirt, and possibly stickers too, just by participating and submitting 5 PRs on GitHub.
It runs till the end of the month. I wrote this post to track merged/meaningful pull requests that count for Hacktoberfest. So this was my initial step toward winning the T-shirt. It is amazing how well it fits with the Utopian intention of sharing your work.
So, 4 PRs to go. Hopefully, I will find something more to improve in Beem or maybe some other projects will pop up that have issues to work on.
Links
- My account on GitHub: https://github.com/espoem
- Pull request with the fix: https://github.com/holgern/beem/pull/95