scrapinghub / scrapinghub/python-scrapinghub

Difference between jobs.iter and jobs.iter_last

Open
#134 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
205
Forks
62
PR merge metrics
No merged PRs in 30d

Description

The documentation for jobs.iter says

by default :meth:Jobs.iter returns maximum last 1000 results.
which implies that it will return the most recent (first 1000 sorted in decreasing chronological order).

The documentation for jobs.iter_last says

Iterate through last jobs for each spider.
which implies that it will return the jobs with the highest chronological value (that is to say, the first n jobs sorted in decreasing chronological order).

I would guess that they're not both returning the latest jobs, however with limited job retention I can't imagine a situation where you'd actually want the results in increasing chronological order.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Jobs.iter and Jobs.iter_last entry points and read their documentation and implementation to determine how their result limits and ordering differ. Update the documentation so each method's behavior is unambiguous, then verify that the wording matches the observed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.