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

Include stats property to Job instance #102

Open
rennerocha opened this issue Oct 2, 2018 · 2 comments
Open

Include stats property to Job instance #102

rennerocha opened this issue Oct 2, 2018 · 2 comments

Comments

@rennerocha
Copy link

rennerocha commented Oct 2, 2018

More than once I needed to get the stats of a job using scrapinghub library, but it is not well documented that I can find this information using job.metadata.get("scrapystats") (the information is there but it took a while for me to figure out how to get the job stats).

As this seems (at least for my latest usages of the library), something that it is used frequently, what do you think to include a new property in Job to return the dictionary with the job stats (similar to items.Items.stats()).

@vshlapakov
Copy link
Contributor

Hey @rennerocha Sorry for the long response. I think such addition would be consistent and I like the idea in general. The only thing is that I'd stay with a method, not a property, so jobs.Job.stats(), to match with the current design. Do you want to prepare a PR?

@rennerocha
Copy link
Author

Hi @vshlapakov ! I will work on this and send a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants