From d939cbdc8da2ec7d338144f83d63c2678995021d Mon Sep 17 00:00:00 2001 From: Adrian Edwards Date: Wed, 8 Jul 2026 10:18:38 -0400 Subject: [PATCH 1/2] Remove Python2 only code branch Signed-off-by: Adrian Edwards --- .../data_analysis/message_insights/message_sentiment.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/collectoss/tasks/data_analysis/message_insights/message_sentiment.py b/collectoss/tasks/data_analysis/message_insights/message_sentiment.py index 4ce60c7d6..c2113b8d9 100644 --- a/collectoss/tasks/data_analysis/message_insights/message_sentiment.py +++ b/collectoss/tasks/data_analysis/message_insights/message_sentiment.py @@ -37,12 +37,8 @@ train_path = os.path.join(ROOT_PROJECT_REPO_DIRECTORY, "tasks", "data_analysis", "message_insights", "train_data") def replace_all(text, dic): - if(sys.version_info[0] < 3): - for i, j in dic.iteritems(): - text = text.replace(i, j) - else: - for i, j in dic.items(): - text = text.replace(i, j) + for i, j in dic.items(): + text = text.replace(i, j) return text stemmer = SnowballStemmer("english") From 0f1ee65751f242c8d238a0756307a2aff3dbe60c Mon Sep 17 00:00:00 2001 From: Adrian Edwards Date: Wed, 8 Jul 2026 10:19:05 -0400 Subject: [PATCH 2/2] syntax error in pandas group_by usage Signed-off-by: Adrian Edwards --- collectoss/api/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collectoss/api/server.py b/collectoss/api/server.py index 7955cd7a1..cceb28a52 100644 --- a/collectoss/api/server.py +++ b/collectoss/api/server.py @@ -170,7 +170,7 @@ def route_transform(func: Any, args: Any=None, kwargs: dict=None, repo_url_base: # if group_by is defined it groups by the group_by value # and uses the aggregate to determine the operation performed if group_by is not None: - data = data.group_by(group_by).aggregate(aggregate) + data = data.groupby(group_by).aggregate(aggregate) # This code block is resampling the pandas dataframe, here is the documentation for it # https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.resample.html