adapter.aasx: Missing supplementary file aborts reading with failsafe
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
从链接行中的 sdk/basyx/aas/adapter/aasx.py 的 _add_supplementary_file() 和 open_part() 调用开始。检查现有读取路径如何处理缺失的包部件,以及如何测试 failsafe 模式。完成标准是:使用 failsafe=True 时,缺失的补充部件会被记录日志并跳过;使用 failsafe=False 时,会引发明确的错误。
由索引模型根据 Issue 内容生成。
描述
AASXReader.read_into() raises KeyError when a File element
or the default thumbnail points to a part that is not in the package,
even with failsafe=True:
The object is already in the object_store at that point, so the
read stops half-way.
Steps to reproduce:
sm = model.Submodel("urn:sm:1", submodel_element=[
model.File("f", "application/pdf", "/aasx/missing.pdf")])
# the writer only logs a warning and writes the package
with aasx.AASXWriter("x.aasx", failsafe=True) as w:
w.write_all_aas_objects(
"/aasx/data.json", model.DictIdentifiableStore([sm]),
aasx.DictSupplementaryFileContainer())
with aasx.AASXReader("x.aasx", failsafe=True) as r:
r.read_into(model.DictIdentifiableStore(),
aasx.DictSupplementaryFileContainer())
# KeyError: 'Could not find part /aasx/missing.pdf in package'
The repository server calls load_directory() at import, so one such
file in INPUT stops the container from starting.
Expected behavior: With failsafe=True, the missing part is
logged and skipped, like other defects. With failsafe=False, a clear
error is raised.
Actual behavior: KeyError in both modes; the objects read so far
stay in the store.
Environment: develop @ 2773ac06.
Possible fix: Catch KeyError around open_part() in
_add_supplementary_file(): log and return None if failsafe,
otherwise re-raise. Our own writer produces such packages in failsafe
mode (see #228), so the reader should accept them.
- 主要语言
- Python
- 星标
- 106
- 派生
- 59
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eclipse-basyx/basyx-python-sdk 的其他 Issue
-
server: XML responses contain `cursor="None"` on the last page可能已有人在做 @qiaobochi040726-source 于 5 天前认领。 未关闭bug good-first-issue server
难度 2/5 1-3 小时 新手友好度 82/100
eclipse-basyx/basyx-python-sdk#673 ·
维护者通常 4 天内回复
-
adapter.aasx: Failsafe writer adds duplicate parts for conflicting files可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug good-first-issue sdk
难度 2/5 1-3 小时 新手友好度 85/100
eclipse-basyx/basyx-python-sdk#671 ·
维护者通常 4 天内回复
-
enhancement good-first-issue server
难度 2/5 1-3 小时 新手友好度 80/100
eclipse-basyx/basyx-python-sdk#670 ·
维护者通常 4 天内回复
-
bug server
难度 2/5 1-3 小时 新手友好度 76/100
eclipse-basyx/basyx-python-sdk#663 ·
维护者通常 4 天内回复
-
README CI badge is broken可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug documentation
难度 1/5 1 小时以内 新手友好度 85/100
eclipse-basyx/basyx-python-sdk#656 ·
维护者通常 4 天内回复
查看 eclipse-basyx/basyx-python-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/agent-lightning#661 ·
维护者通常 2 天内回复
-
area/profiles comp/cli P3 type/feature
难度 2/5 1-3 小时 新手友好度 74/100
NousResearch/hermes-agent#146372 ·
维护者通常 1 天内回复
-
[BUG] OpenAI-compatible embedding model alias breaks embedder construction可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistencies可能已有人在做 @github-actions 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
GeoSeries scale and skew tests fail with pytest 9.2.0可能已有人在做 @jiayuasu 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复