cppackage 0.2.5__tar.gz → 0.2.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.
@@ -103,9 +103,14 @@ def add_columns(table_name, database, columns):
103
103
  # 表结构校验
104
104
  def check_and_sync_columns(df ,table_name, database, max_new=5):
105
105
 
106
+ # df字段
106
107
  df_cols = set(df.columns)
107
- db_cols= get_table_columns(table_name, database)
108
+ # 数据库字段
109
+ db_cols = set(get_table_columns(table_name, database))
110
+ # 新增字段
108
111
  new_cols = df_cols - db_cols
112
+
113
+ # 缺失字段(减少的字段,不处理)
109
114
  missing_cols = db_cols - df_cols
110
115
  print("新增字段:", new_cols if new_cols else "无")
111
116
  print("缺失字段(忽略):", missing_cols if missing_cols else "无")
@@ -158,6 +163,8 @@ def update_datas(df, table_name, database):
158
163
  print("入库失败:", e)
159
164
  if '1054, "Unknown column' in str(e):
160
165
  check_and_sync_columns(df,table_name,database)
166
+ else:
167
+ raise Exception(e)
161
168
  finally:
162
169
  if conn:
163
170
  conn.close()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cppackage
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: 超品集团自用的Python包
5
5
  Home-page: https://github.com/example/CPpackage
6
6
  Author: team-数智组
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cppackage
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: 超品集团自用的Python包
5
5
  Home-page: https://github.com/example/CPpackage
6
6
  Author: team-数智组
@@ -10,7 +10,7 @@ with open('readme.md', 'r', encoding='utf-8') as f:
10
10
  # 包的基本信息
11
11
  setup(
12
12
  name='cppackage',
13
- version='0.2.5',
13
+ version='0.2.7',
14
14
  description='超品集团自用的Python包',
15
15
  long_description=long_description,
16
16
  long_description_content_type='text/markdown',
File without changes
File without changes
File without changes
File without changes