superxu520 commited on
Commit
e9ae0e6
·
1 Parent(s): d8438e3

"fix:add-fallback-debug-log"

Browse files
Files changed (1) hide show
  1. sync_data.py +3 -0
sync_data.py CHANGED
@@ -337,7 +337,10 @@ def get_target_daily(code: str, start_date: str, market: str) -> Optional[pd.Dat
337
  else:
338
  bs_code = f"sz{code}"
339
  df = get_stock_daily_baostock(bs_code, fetch_start, end_date)
 
 
340
  if df is None:
 
341
  df = ak.stock_zh_a_hist(symbol=code, period="daily", start_date=fetch_start, end_date=end_date, adjust="hfq")
342
 
343
  if df is not None and not df.empty:
 
337
  else:
338
  bs_code = f"sz{code}"
339
  df = get_stock_daily_baostock(bs_code, fetch_start, end_date)
340
+ if df is not None:
341
+ logger.debug(f"Got data from BaoStock for {code}")
342
  if df is None:
343
+ logger.debug(f"BaoStock failed or unavailable, falling back to AkShare for {code}")
344
  df = ak.stock_zh_a_hist(symbol=code, period="daily", start_date=fetch_start, end_date=end_date, adjust="hfq")
345
 
346
  if df is not None and not df.empty: