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
b46bf8d7e0
commit
65e8ed3d64
7 files changed
+58
-52
No files matched your search
+1
-10
@@ -74,6 +74,7 @@ import json
|
||||
import time
|
||||
import uuid
|
||||
|
||||
from cloud.peer_messages import row_get
|
||||
from cloud.timeouts import APPROVAL_DEFAULT_SECONDS as _APPROVAL_DEFAULT
|
||||
from cloud.timeouts import expires_at_for as _expires_at_for
|
||||
from cloud.timeouts import resolve_module_timeout as _resolve_timeout
|
||||
@@ -86,16 +87,6 @@ MAX_SUMMARY_CHARS = 2000
|
||||
MAX_DETAIL_CHARS = 20000
|
||||
|
||||
|
||||
def row_get(row, name):
|
||||
"""行取值容错:sqlite3.Row 缺列报 IndexError、dict 缺键报
|
||||
KeyError、空行报 TypeError,一律回 None(与 peer_messages
|
||||
的同名函数同款,模块独立所以这里自带一份)。"""
|
||||
try:
|
||||
return row[name]
|
||||
except (KeyError, IndexError, TypeError):
|
||||
return None
|
||||
|
||||
|
||||
def ensure_approvals_table(conn):
|
||||
"""幂等建审批队列表。调用方负责 commit(服务端入口在写
|
||||
操作后统一 commit;本函数自己不 commit,避免半截事务)。"""
|
||||
|
||||
Reference in new issue
Block a user