Skip to content

Commit

Permalink
Merge pull request #8 from kingkaki/fix-none-field
Browse files Browse the repository at this point in the history
[Fix] 修复可能的None字段
  • Loading branch information
vnpy authored Dec 6, 2021
2 parents 640c3ce + c783bd7 commit 199ad22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vnpy_tushare/tushare_datafeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def query_bar_history(self, req: HistoryRequest) -> Optional[List[BarData]]:
low_price=round_to(row["low"], 0.000001),
close_price=round_to(row["close"], 0.000001),
volume=row["vol"],
turnover=row.get("amount", 0),
open_interest=row.get("oi", 0),
turnover=row.get("amount", 0) if row.get("amount", 0) else 0,
open_interest=row.get("oi", 0) if row.get("oi", 0) else 0,
gateway_name="TS"
)

Expand Down

0 comments on commit 199ad22

Please sign in to comment.