@@ -192,15 +192,21 @@ def search(self, query: Query, context: Context) -> Tuple[Context, pd.DataFrame]
192192 if t5_rewriter_module .COPY_REWRITTEN_QUERY_COLUMN in result .columns :
193193 temp_result = result [result ["qid" ] == query .query_id ]
194194 if not temp_result .empty :
195- query .query = temp_result .at [temp_result .index [0 ], t5_rewriter_module .COPY_REWRITTEN_QUERY_COLUMN ]
195+ query .query = temp_result [
196+ t5_rewriter_module .COPY_REWRITTEN_QUERY_COLUMN
197+ ].iloc [0 ]
196198 else :
197- warnings .warn (f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} " )
199+ warnings .warn (
200+ f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} "
201+ )
198202 else :
199203 temp_result = result [result ["qid" ] == query .query_id ]
200204 if not temp_result .empty :
201- query .query = temp_result . at [ temp_result . index [ 0 ], "query" ]
205+ query .query = temp_result [ "query" ]. iloc [ 0 ]
202206 else :
203- warnings .warn (f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} " )
207+ warnings .warn (
208+ f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} "
209+ )
204210
205211 doc_list : List [Document ] = []
206212 for _ , entry in result .iterrows ():
@@ -238,16 +244,22 @@ def batch_search(
238244 for query , _ in inputs :
239245 temp_result = result [result ["qid" ] == query .query_id ]
240246 if not temp_result .empty :
241- query .query = temp_result .at [temp_result .index [0 ], t5_rewriter_module .COPY_REWRITTEN_QUERY_COLUMN ]
247+ query .query = temp_result [
248+ t5_rewriter_module .COPY_REWRITTEN_QUERY_COLUMN
249+ ].iloc [0 ]
242250 else :
243- warnings .warn (f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} " )
251+ warnings .warn (
252+ f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} "
253+ )
244254 else :
245255 for query , _ in inputs :
246256 temp_result = result [result ["qid" ] == query .query_id ]
247257 if not temp_result .empty :
248- query .query = temp_result . at [ temp_result . index [ 0 ], "query" ]
258+ query .query = temp_result [ "query" ]. iloc [ 0 ]
249259 else :
250- warnings .warn (f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} " )
260+ warnings .warn (
261+ f"Query { query .query_id } not found in result. This should not happen. All query-ids: { result ['qid' ].unique ()} "
262+ )
251263
252264 contexts : List [Context ] = []
253265 for query , context in inputs :
0 commit comments