espoem avatar

Hacktoberfest #1: Beem minor fix

espoem

Published: 06 Oct 2018 › Updated: 06 Oct 2018Hacktoberfest #1: Beem minor fix

Hacktoberfest #1: Beem minor fix

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.

Beem banner

website steem github discord

While working on my mini project, where I use Beem by holger80@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.

Code example

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.

steem github

Links

Leave Hacktoberfest #1: Beem minor fix to:

Written by

Read more #hacktoberfest posts


Best Posts From espoem

We have not curated any of espoem's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From espoem