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

It appears that the "stats_numbers" classmethod in Stats class has the wrong function prototype #37

Closed
dreemkiller opened this issue Aug 26, 2016 · 1 comment
Assignees

Comments

@dreemkiller
Copy link

I am hesitant to report this as a bug, because I'm not doing anything out of the ordinary with my project, and I would have expected someone else to see this, but it does appear to be a bug.

In the stats.py file, the stats_numbers classmethod has a prototype of:
def stats_numbers(cls, data):

I am seeing an error as follows:
TypeError: stats_numbers() takes exactly 2 arguments (3 given)
from the getattr function call in the classmethod _stats (same file - line 37 in my version).
It also prevents the graph on the stats page from rendering (which makes sense since the server code threw an exception).

Looking at the rest of the stats_* classmethods in the class, they all have an additional input parameter (either period or key) that the stats_numbers method is missing, and the _stats function is definitely calling it with 2 explicit arguments (and 1 implied argument).
I believe the solution is to change the prototype of stats_numbers to as follows:
def stats_numbers(cls, data, period):
and to not use the data provided in the period argument. (Could also name it ignore or something else descriptive).

Anyway, doing this in my environment solved the problem, and the graph renders correctly.

@zhebrak zhebrak self-assigned this Aug 26, 2016
@zhebrak
Copy link
Owner

zhebrak commented Nov 2, 2016

@dreemkiller Thank you for the report! It should be fixed by now. Feel free to write in case you need something particular.

@zhebrak zhebrak closed this as completed Nov 2, 2016
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

No branches or pull requests

2 participants