fix: add missing pandas import and fix JSON Unicode encoding
- Fix 'name pd is not defined' error in _get_stock_stats_bulk by adding missing pandas import - Add ensure_ascii=False to json.dump() to properly display Chinese characters in log files
This commit is contained in:
parent
4641c03340
commit
385381c469
|
|
@ -1,6 +1,7 @@
|
|||
from typing import Annotated
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
import pandas as pd
|
||||
import yfinance as yf
|
||||
import os
|
||||
from .stockstats_utils import StockstatsUtils, _clean_dataframe, yf_retry, load_ohlcv, filter_financials_by_date
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ class TradingAgentsGraph:
|
|||
"w",
|
||||
encoding="utf-8",
|
||||
) as f:
|
||||
json.dump(self.log_states_dict, f, indent=4)
|
||||
json.dump(self.log_states_dict, f, indent=4, ensure_ascii=False)
|
||||
|
||||
def reflect_and_remember(self, returns_losses):
|
||||
"""Reflect on decisions and update memory based on returns."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue