(mentions: Any)
| 4103 | include_user_node = True |
| 4104 | if src_id not in node_by_id and src_id != user_node_id: |
| 4105 | continue |
| 4106 | if dst_id not in node_by_id and dst_id != user_node_id: |
| 4107 | continue |
| 4108 | try: |
| 4109 | metadata = json.loads(row["metadata_json"] or "{}") |
| 4110 | except (TypeError, json.JSONDecodeError): |
| 4111 | metadata = {} |
| 4112 | edges.append( |
| 4113 | { |
| 4114 | "src_id": src_id, |
| 4115 | "dst_id": dst_id, |
| 4116 | "relation": row["relation"], |
| 4117 | "weight": float(row["weight"] or 1.0), |
| 4118 | "metadata": _compact_wiki_metadata(metadata), |
| 4119 | } |
| 4120 | ) |
| 4121 | edges.extend( |
| 4122 | edge |
no test coverage detected