fix(bitable): 规范化复杂字段索引匹配#10
Merged
Merged
Conversation
66e8488 to
6b12eba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
修复 #9:多维表格在使用索引列匹配记录时,远端字段返回值可能是富文本对象列表、日期毫秒时间戳、公式/查找引用包装结构等复杂类型。原逻辑在本地和远端两侧使用了不一致的字符串化方式,导致本应更新的记录无法命中索引,进而被当作新增记录处理。
问题归因
[{"text": "...", "type": "text"}]这类富文本片段列表。Asia/Shanghai等时区出现跨日偏移。{type, value}包装结构,不能直接str()后参与 hash。pd.isnull()/pd.notnull()直接处理 list/dict 会出现歧义,容易在复杂字段写入或预检查阶段中断同步。变更内容
[{"text": "...", "type": "text"}]、list[str]与普通字符串按同一文本值匹配。{type, value}结构展开后参与索引匹配。full、incremental、overwrite三种 Bitable 同步路径中传入字段类型,确保索引构建和本地行匹配使用同一规则。pd.isnull()/pd.notnull()处理 list/dict 时出现歧义。list[str]、日期时间戳、日期本地时区 roundtrip、公式包装、空复杂字段和多值复杂字段。验证
按要求未进行真实飞书运行测试,没有使用真实 token 调用飞书 API。已完成本地静态/单元验证:
PYTHONPATH=. python3 -m pytest tests/test_converter.py -q:57 passedPYTHONPATH=. python3 -m pytest tests/ -q -m "not integration":164 passed,本机 requests 依赖版本 warning 不影响结果python3 -m ruff check . --ignore E501,F401python3 -m black --check .python3 -m mypy core/ api/ utils/ --ignore-missing-importspython3 -m py_compile XTF.py core/*.py api/*.py utils/*.pygit diff --check origin/main...HEAD && git diff --check已补充本地最小复现验证:多段富文本、多值人员字段、空富文本索引、日期字段写出后读回 roundtrip 均通过。
远端 GitHub Actions 已通过当前 head 的
Code Quality、Test Summary、Ubuntu/macOS/Windows 全矩阵 Unit Tests。当前 head 为f0e8737b6a970be01adda25e889279a836d7441d。Closes #9