From 82bc922ccac4de215bdea110cce3a4976536ad00 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 22 Feb 2023 17:50:44 -0800 Subject: [PATCH] Transform comment parent_id from pushshift api. Re #19 --- timesearch_modules/pushshift.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/timesearch_modules/pushshift.py b/timesearch_modules/pushshift.py index aa48ba4..7db4ee8 100644 --- a/timesearch_modules/pushshift.py +++ b/timesearch_modules/pushshift.py @@ -71,6 +71,11 @@ class DummyObject: val = DummyObject(display_name=val) elif key in ['body', 'selftext']: val = html.unescape(val) + elif key == 'parent_id': + if val is None: + val = attributes['link_id'] + elif isinstance(val, int): + val = 't1_' + common.b36(val) setattr(self, key, val)