From 28137505c3711fb153975dff3c7436df66decde9 Mon Sep 17 00:00:00 2001 From: foolcage <5533061@qq.com> Date: Thu, 6 Jun 2024 23:26:26 +0800 Subject: [PATCH] Fix package dep --- setup.py | 33 ++++++++++++++---------- src/zvt/contract/register.py | 50 ++++++++++++++++++------------------ 2 files changed, 44 insertions(+), 39 deletions(-) diff --git a/setup.py b/setup.py index 10e60c1a..4fb49997 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], keywords="quant stock finance fintech big-data zvt technical-analysis trading-platform pandas fundamental-analysis", package_dir={"": "src"}, @@ -39,21 +40,25 @@ python_requires=">=3.8, <4", include_package_data=True, install_requires=[ - "requests == 2.20.1", - "SQLAlchemy == 1.4.20", - "pandas == 1.1.4", - "arrow == 1.2.1", - "xlrd == 1.2.0", - "demjson3 == 3.0.5", - "marshmallow-sqlalchemy == 0.23.1", - "marshmallow == 3.2.2", - "plotly==4.12.0", - "dash==1.17.0", - "simplejson==3.16.0", - "jqdatapy==0.1.6", - "dash-bootstrap-components==0.11.0", + "requests==2.31.0", + "SQLAlchemy==2.0.28", + "pandas==2.0.3", + "pydantic==2.6.4", + "arrow==1.2.3", + "openpyxl==3.1.1", + "demjson3==3.0.6", + "marshmallow-sqlalchemy==1.0.0", + "marshmallow==3.21.1", + "plotly==5.13.0", + "dash==2.8.1", + "jqdatapy==0.1.8", + "dash-bootstrap-components==1.3.1", "dash_daq==0.5.0", - "scikit-learn==1.0.1", + "scikit-learn==1.2.1", + "fastapi==0.110.0", + "fastapi-pagination==0.12.23", + "apscheduler==3.10.4", + "eastmoneypy==0.1.7", ], project_urls={ # Optional "Bug Reports": "https://github.com/zvtvz/zvt/issues", diff --git a/src/zvt/contract/register.py b/src/zvt/contract/register.py index 5002f638..d1cd5515 100644 --- a/src/zvt/contract/register.py +++ b/src/zvt/contract/register.py @@ -124,34 +124,34 @@ def register_schema( ) logger.info(f"{engine.url} migrations:\n {stmt}") con.execute(stmt) + + logger.debug("engine:{},table:{},index:{}".format(engine, table_name, index_list)) + + for col in [ + "timestamp", + "entity_id", + "code", + "report_period", + "created_timestamp", + "updated_timestamp", + ]: + if col in table.c: + column = eval("table.c.{}".format(col)) + index_name = "{}_{}_index".format(table_name, col) + if index_name not in index_list: + index = sqlalchemy.schema.Index(index_name, column) + index.create(engine) + for cols in [("timestamp", "entity_id"), ("timestamp", "code")]: + if (cols[0] in table.c) and (col[1] in table.c): + column0 = eval("table.c.{}".format(col[0])) + column1 = eval("table.c.{}".format(col[1])) + index_name = "{}_{}_{}_index".format(table_name, col[0], col[1]) + if index_name not in index_list: + index = sqlalchemy.schema.Index(index_name, column0, column1) + index.create(engine) except Exception as e: logger.error(e) - logger.debug("engine:{},table:{},index:{}".format(engine, table_name, index_list)) - - for col in [ - "timestamp", - "entity_id", - "code", - "report_period", - "created_timestamp", - "updated_timestamp", - ]: - if col in table.c: - column = eval("table.c.{}".format(col)) - index_name = "{}_{}_index".format(table_name, col) - if index_name not in index_list: - index = sqlalchemy.schema.Index(index_name, column) - index.create(engine) - for cols in [("timestamp", "entity_id"), ("timestamp", "code")]: - if (cols[0] in table.c) and (col[1] in table.c): - column0 = eval("table.c.{}".format(col[0])) - column1 = eval("table.c.{}".format(col[1])) - index_name = "{}_{}_{}_index".format(table_name, col[0], col[1]) - if index_name not in index_list: - index = sqlalchemy.schema.Index(index_name, column0, column1) - index.create(engine) - # the __all__ is generated __all__ = ["register_entity", "register_schema"]