Skip to content

Commit

Permalink
Fix package dep
Browse files Browse the repository at this point in the history
  • Loading branch information
foolcage committed Jun 6, 2024
1 parent ec1a373 commit 2813750
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 39 deletions.
33 changes: 19 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,33 @@
"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"},
packages=find_packages(where="src"),
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",
Expand Down
50 changes: 25 additions & 25 deletions src/zvt/contract/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit 2813750

Please sign in to comment.