Skip to content

Commit

Permalink
Update api.py
Browse files Browse the repository at this point in the history
修复 zvtvz#79 在win环境下sqlite一次性插入过多数据报错的问题。
  • Loading branch information
scanfyu authored Aug 4, 2020
1 parent d6a5b9e commit 00d36b3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zvt/contract/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import os
from typing import List, Union
import platform

import pandas as pd
from sqlalchemy import create_engine
Expand Down Expand Up @@ -421,6 +422,9 @@ def df_to_db(df: pd.DataFrame,

size = len(df)

if platform.system() == "Windows":
sub_size = 900

if size >= sub_size:
step_size = int(size / sub_size)
if size % sub_size:
Expand Down

0 comments on commit 00d36b3

Please sign in to comment.