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

Sort = "created_utc" didnt sort results properly #63

Open
grejty opened this issue Apr 13, 2023 · 1 comment
Open

Sort = "created_utc" didnt sort results properly #63

grejty opened this issue Apr 13, 2023 · 1 comment

Comments

@grejty
Copy link

grejty commented Apr 13, 2023

My code looks like this:

gen = list(api.search_submissions(q="fire",
sort="created_utc",
order="desc",
subreddit=subreddit,
filter=['id'],
limit=None))

for pmaw_submission in gen:
praw_submission = reddit.submission(id=pmaw_submission['id'])
print(datetime.utcfromtimestamp(praw_submission.created_utc))

Returns the following: https://pastebin.com/Y91fYYDy

You can see the years are not in order, otherwise, it kinda looks ordered, if we talking days/time only

Any idea why is this happening / how to fix this? Thanks

@grejty
Copy link
Author

grejty commented Apr 13, 2023

Overall, the query is returning submission in different order everytime it's ran

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

1 participant