def get_comments_from_parent(doc):
	try:
		_comments = frappe.db.get_value(doc.reference_doctype, doc.reference_name, "_comments") or "[]"

	except Exception, e:
		if e.args[0] in (1146, 1054):
			# 1146 = no table
			# 1054 = missing column
			_comments = "[]"

		else:
			raise

	try:
		return json.loads(_comments)
	except __HOLE__:
		return []
dataset/ETHPy150Open frappe/frappe/frappe/core/doctype/communication/comment.py/get_comments_from_parent