diff --git a/src/unitxt/text2sql_utils.py b/src/unitxt/text2sql_utils.py index 5c829ae06f..6c02d96a90 100644 --- a/src/unitxt/text2sql_utils.py +++ b/src/unitxt/text2sql_utils.py @@ -856,8 +856,10 @@ def rows_to_multisets(df): def sort_df(df): sorted_df = df.copy() - for col in sorted_df.columns: - sorted_df[col] = sorted_df[col].astype(str).sort_values(ignore_index=True) + for i in range(len(sorted_df.columns)): + sorted_df.iloc[:, i] = ( + sorted_df.iloc[:, i].astype(str).sort_values(ignore_index=True) + ) return sorted_df if df1.empty or df2.empty or len(df1) != len(df2):