gapfill G3: unify all 5 private row_get onto peer_messages.row_get (approvals, automations, marker_tools, todos, wait_ops; resident import retargeted); semantics identical on None/dict/sqlite3.Row, identity tests added
This commit is contained in:
1 parent
5ca642c86e
commit
aa6179b5e1
7 files changed
+58
-52
No files matched your search
@@ -56,6 +56,7 @@ import time
|
||||
import uuid
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from cloud.peer_messages import row_get
|
||||
from cloud.quota import decide as _quota_decide
|
||||
from cloud.quota import default_quota_usd_micros as _quota_default
|
||||
from cloud.quota import monthly_usage as _quota_monthly_usage
|
||||
@@ -73,14 +74,9 @@ ACTIVE = "active"
|
||||
CANCELLED = "cancelled"
|
||||
|
||||
|
||||
def row_get(row, name):
|
||||
"""行取值容错:sqlite3.Row 缺列报 IndexError、dict 缺键报
|
||||
KeyError、空行报 TypeError,一律回 None(老库行缺列时
|
||||
读自动化列表不能因此炸掉整页)。"""
|
||||
try:
|
||||
return row[name]
|
||||
except (KeyError, IndexError, TypeError):
|
||||
return None
|
||||
# 行取值走 cloud.peer_messages.row_get(A7 全仓统一):旧私有版
|
||||
# 与统一版在真实行类型(None / dict / sqlite3.Row)下语义完全
|
||||
# 相同(缺键/缺列/空行一律回 None),故直接复用,不再自带一份。
|
||||
|
||||
|
||||
AUTOMATION_COLUMNS = (
|
||||
|
||||
Reference in new issue
Block a user