diff --git a/agent/tools/exesql.py b/agent/tools/exesql.py index 464f06095..2e1cc24bf 100644 --- a/agent/tools/exesql.py +++ b/agent/tools/exesql.py @@ -162,6 +162,8 @@ class ExeSQL(ToolBase, ABC): if pd.api.types.is_datetime64_any_dtype(df[col]): df[col] = df[col].dt.strftime("%Y-%m-%d") + df = df.where(pd.notnull(df), None) + sql_res.append(convert_decimals(df.to_dict(orient="records"))) formalized_content.append(df.to_markdown(index=False, floatfmt=".6f")) @@ -197,6 +199,8 @@ class ExeSQL(ToolBase, ABC): if pd.api.types.is_datetime64_any_dtype(single_res[col]): single_res[col] = single_res[col].dt.strftime('%Y-%m-%d') + single_res = single_res.where(pd.notnull(single_res), None) + sql_res.append(convert_decimals(single_res.to_dict(orient='records'))) formalized_content.append(single_res.to_markdown(index=False, floatfmt=".6f"))