Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Missing records during retrieval even when all shards are up #47

@strang3qu4rk

Description

@strang3qu4rk

PSAW uses desc sort when making queries involving time intervals and uses last record in the previous request to set the next 'before' value for paging. However because the 'before' and 'after' values are not inclusive in Pushshift, if multiple records with same timestamp occur on the temporal boundaries of the paging requests there will be missing records in the retrieved results. Switching to asc sort will also produce missing records for the same reasons albeit different ones.

Example:

start = 1527811200 
 end = 1559347200 
 gen = api.search_comments(after=start, before=end,
                            subreddit='jobs', aggs='subreddit')
next(gen)

Output: {'subreddit': [{'doc_count': 353029, 'key': 'jobs'}]}

There should be 353029 records, however when the data is retrieved there are only 353024.

gen =list(api.search_comments(after=start, before=end,
                            subreddit='jobs'))
len(gen)

Output: 353024

This discrepancy happens even though all shards are up, in fact if they weren't aggs would be reporting a different value.

(Please note at the moment of writing this 4 shards are down so the test cannot be performed until that is fixed)
Quick check if all shards are up on this data range

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions