<commit_before>import frappe

from frappe.core.doctype.communication.comment import update_comment_in_doc

def execute():
	for d in frappe.db.get_all("Communication",
		fields = ['name', 'reference_doctype', 'reference_name', 'content', 'communication_type'],
		filters = {'communication_type': 'Communication'}):

		try:
			update_comment_in_doc(d)
		except frappe.ImplicitCommitError:
			pass<commit_msg>[fix] communication doc patch minimise dataset returned to prevent memory overflow (#2403)<commit_after>import frappe

from frappe.core.doctype.communication.comment import update_comment_in_doc

def execute():
	for d in frappe.db.get_all("Communication",
		fields = ['name', 'reference_doctype', 'reference_name', 'SUBSTRING(content,1,102)', 'communication_type'],
		filters = {"reference_name":None,"reference_doctype":None,'communication_type': 'Communication'}):

		try:
			update_comment_in_doc(d)
		except frappe.ImplicitCommitError:
			pass
{'fraction_non_alphanumeric': 0.12067156348373557, 'fraction_numerical': 0.008394543546694649, 'mean_word_length': 7.224137931034483, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5823290', 'n_tokens_mistral': 326, 'n_tokens_neox': 295, 'n_words': 62}