Hacktoberfest #1: Beem minor fix

in #hacktoberfest6 years ago

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, 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

Sort:  

This is a great contribution to see in the development category. Very well explained the problem and solution. The changes include also docstrings and follow the python best practices.

Even though the amount of code is small compared to what we have on average, I really like the contributions includes collaboration with the project owners.

If the pull request had include a unit test about the case, that would be perfect.

Good luck in the Hacktoberfest. I had one of their t-shirts. Still using it :)


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Hey, thanks for the review. I will look into tests more and how I could include them in potential PRs. I will do my best in the Hacktoberfest, already submitted another PR with yet another minor fix in beem. But still waiting for someone to review it. :)

I guess I will spend my time with the API endpoints and Beem. Especially the Condenser API and even the AppBase APIs seem to be broken in some cases. Though, I am not sure if I had any chance in reporting them to Steem repo or just making Beem's docs better and spot some bugs if there are any.

Thank you for your review, @emrebeyler!

So far this week you've reviewed 2 contributions. Keep up the good work!

Hi @espoem!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Want to race?

Haha. I'll be honestly happy if I get 5 PRs that make sense are useful than just making PRs for my projects. I "lost" 1 PR as I submitted the edits to utopian.rocks too early.

well, I am in.

Sitting at #1 :(

Screen Shot 2018-10-06 at 10.49.39 PM.png

I upvoted your post.

Mabuhay, keep steeming.
@Filipino

Posted using https://Steeming.com condenser site.

Hey, @espoem!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.15
TRX 0.16
JST 0.028
BTC 67715.17
ETH 2423.95
USDT 1.00
SBD 2.37