def update_comments_in_parent(reference_doctype, reference_name, _comments):
	if not reference_doctype or frappe.db.get_value("DocType", reference_doctype, "issingle"):
		return

	try:
		# use sql, so that we do not mess with the timestamp
		frappe.db.sql("""update `tab%s` set `_comments`=%s where name=%s""" % (reference_doctype,
			"%s", "%s"), (json.dumps(_comments), reference_name))

	except Exception, e:
		if e.args[0] == 1054 and getattr(frappe.local, 'request', None):
			# missing column and in request, add column and update after commit
			frappe.local._comments = (getattr(frappe.local, "_comments", [])
				+ [(reference_doctype, reference_name, _comments)])
		else:
			raise ImplicitCommitError

	else:
		if not frappe.flags.in_patch:
			reference_doc = frappe.get_doc(reference_doctype, reference_name)
			if getattr(reference_doc, "get_route", None):
				clear_cache(reference_doc.get_route())
register a command line option.
dataset/ETHPy150Open frappe/frappe/frappe/core/doctype/communication/comment.py/update_comments_in_parent--crossover with--dataset/ETHPy150Open pytest-dev/pytest/_pytest/config.py/Parser.addoption