@@ -116,15 +116,15 @@ async def create_final_community_reports(
116116def _prep_nodes (input : pd .DataFrame ) -> pd .DataFrame :
117117 """Prepare nodes by filtering, filling missing descriptions, and creating NODE_DETAILS."""
118118 # Filter rows where community is not -1
119- input = input [input [ COMMUNITY_ID ] != - 1 ]
119+ input = input . loc [input . loc [:, COMMUNITY_ID ] != - 1 ]
120120
121121 # Fill missing values in NODE_DESCRIPTION
122122 input .loc [:, NODE_DESCRIPTION ] = input .loc [:, NODE_DESCRIPTION ].fillna (
123123 "No Description"
124124 )
125125
126126 # Create NODE_DETAILS column
127- input . loc [:, NODE_DETAILS ] = input .loc [
127+ input [ NODE_DETAILS ] = input .loc [
128128 :, [NODE_ID , NODE_NAME , NODE_DESCRIPTION , NODE_DEGREE ]
129129 ].to_dict (orient = "records" )
130130
@@ -136,7 +136,7 @@ def _prep_edges(input: pd.DataFrame) -> pd.DataFrame:
136136 input .fillna (value = {NODE_DESCRIPTION : "No Description" }, inplace = True )
137137
138138 # Create EDGE_DETAILS column
139- input [EDGE_DETAILS ] = input [
139+ input [EDGE_DETAILS ] = input . loc [:,
140140 [EDGE_ID , EDGE_SOURCE , EDGE_TARGET , EDGE_DESCRIPTION , EDGE_DEGREE ]
141141 ].to_dict (orient = "records" )
142142
@@ -148,7 +148,7 @@ def _prep_claims(input: pd.DataFrame) -> pd.DataFrame:
148148 input .fillna (value = {NODE_DESCRIPTION : "No Description" }, inplace = True )
149149
150150 # Create CLAIM_DETAILS column
151- input [CLAIM_DETAILS ] = input [
151+ input [CLAIM_DETAILS ] = input . loc [:,
152152 [CLAIM_ID , CLAIM_SUBJECT , CLAIM_TYPE , CLAIM_STATUS , CLAIM_DESCRIPTION ]
153153 ].to_dict (orient = "records" )
154154
0 commit comments