ezKit 1.9.6__tar.gz → 1.9.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.9.6
3
+ Version: 1.9.7
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -295,13 +295,20 @@ def save_data_to_database(engine: Engine, code: str, latest: bool = False) -> bo
295
295
  df: DataFrame | None = get_stock_data_from_akshare(code)
296
296
 
297
297
  if df is None:
298
+ logger.error(f"{info} [获取数据失败]")
299
+ return False
300
+
301
+ name = coderename(code)
302
+
303
+ if not isinstance(name, str):
304
+ logger.error(f"{info} [代码名称转换失败]")
298
305
  return False
299
306
 
300
307
  if utils.isTrue(latest, bool):
301
308
  df = df.tail(1)
302
- df.to_sql(name=code, con=engine, if_exists="append", index=False)
309
+ df.to_sql(name=name, con=engine, if_exists="append", index=False)
303
310
  else:
304
- df.to_sql(name=code, con=engine, if_exists="replace", index=False)
311
+ df.to_sql(name=name, con=engine, if_exists="replace", index=False)
305
312
 
306
313
  logger.success(f"{info} [成功]")
307
314
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ezKit
3
- Version: 1.9.6
3
+ Version: 1.9.7
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
3
3
 
4
4
  setup(
5
5
  name='ezKit',
6
- version='1.9.6',
6
+ version='1.9.7',
7
7
  author='septvean',
8
8
  author_email='septvean@gmail.com',
9
9
  description='Easy Kit',
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes