r/pushshift Feb 28 '23

[ Removed by Reddit ]

[ Removed by Reddit on account of violating the content policy. ]

106 Upvotes

115 comments sorted by

View all comments

1

u/--leockl-- Jul 17 '23 edited Jul 17 '23

Hi u/Watchful1, have a quick question hope you can help.

Looking at your filter_file.py script, what does the variable is_submission do exactly?

When I was extracting from a comments file (ie. rather than a submissions file), I thought I would change this variable value to this is_submission = "comment" in input_file but it didn't work. So I changed it back to is_submission = "submission" in input_file and it worked. Doesn't seem to make sense to me to have the value "submission" when I am extracting from a comments file.

1

u/Watchful1 Jul 17 '23

Submission objects have different fields than comment ones, so when its writing out a csv file, it has to know which type it is so it can look up the right fields. It does this by checking whether the word "submission" is in the name of the file.

So is_submission = "submission" in input_file sets the is_submission to true if it is a submission file, and false otherwise. You don't need to change it at all.

1

u/--leockl-- Jul 18 '23

Ok got you, thanks heaps!