cppackage 0.2.7__tar.gz → 0.2.8__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.
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage/db/sql_model.py +5 -6
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage.egg-info/PKG-INFO +1 -1
- {cppackage-0.2.7 → cppackage-0.2.8}/PKG-INFO +1 -1
- {cppackage-0.2.7 → cppackage-0.2.8}/setup.py +1 -1
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage/__init__.py +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage/core/__init__.py +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage/db/__init__.py +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage/db/config.py +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage/utils/__init__.py +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage.egg-info/SOURCES.txt +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage.egg-info/dependency_links.txt +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage.egg-info/entry_points.txt +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage.egg-info/not-zip-safe +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage.egg-info/requires.txt +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/CPpackage.egg-info/top_level.txt +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/LICENSE +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/MANIFEST.in +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/readme.md +0 -0
- {cppackage-0.2.7 → cppackage-0.2.8}/setup.cfg +0 -0
|
@@ -115,17 +115,16 @@ def check_and_sync_columns(df ,table_name, database, max_new=5):
|
|
|
115
115
|
print("新增字段:", new_cols if new_cols else "无")
|
|
116
116
|
print("缺失字段(忽略):", missing_cols if missing_cols else "无")
|
|
117
117
|
|
|
118
|
-
#
|
|
119
|
-
if len(
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
# 最大新增字段限制
|
|
119
|
+
if len(db_cols) * 0.2 > max_new:
|
|
120
|
+
max_new = int(len(db_cols) *0.2)
|
|
122
121
|
# 自动补
|
|
123
122
|
if 0 < len(new_cols) <= max_new:
|
|
124
|
-
|
|
125
123
|
print("开始同步字段...")
|
|
126
124
|
add_columns(table_name, database, new_cols)
|
|
127
125
|
print("字段同步成功")
|
|
128
|
-
|
|
126
|
+
else:
|
|
127
|
+
raise Exception(f"新增字段超过{max_new}个: {new_cols}")
|
|
129
128
|
return True
|
|
130
129
|
|
|
131
130
|
|
|
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
|