Give the two FFI example crates a runnable entry point
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 68/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
从 examples/tpch/run_tpch.py、两个 FFI crates 中 python/tests 下现有的 pytest 文件以及 test.yml:136-150 开始,以确认测试命令。添加每个 root run_demo.py、带有 anchor assertions 的 subprocess driver 以及 README Role 标题;完成的标准是两个脚本都能 standalone 运行,且其 driver 测试通过,同时第二个 decode 部分遵循 logical-codec sub-issue。
由索引模型根据 Issue 内容生成。
描述
Neither datafusion-ffi-example nor datafusion-ffi-query-planner-example has a script you can run. They are 51 and 47 pytest assertions respectively. Meanwhile user-guide/data-sources.md:219 calls the first one a "user example" and sends Python users there from the user guide, and io/table_provider.md:30 calls it "a complete example". We promise a runnable example and deliver a test suite.
Precedent: examples/tpch/ — the script is the artifact and a pytest keeps it honest. CI already runs pytest python/tests/_test*.py in each crate directory (test.yml:136-150), so a driver test needs zero workflow changes.
Layout per crate: run_demo.py at the tree root, parallel to the existing examples/distributed/run_tpch.py, and a driver at python/tests/_test_run_demo.py that runs it via subprocess.run([sys.executable, script]) and asserts on anchor lines. Subprocess rather than import_module or runpy, because it proves the thing being asked for: that it runs standalone with no pytest around it.
Each script should open with an import guard that turns the one real failure mode into an instruction rather than a traceback:
try:
from datafusion_ffi_example import MyTableProvider
except ImportError:
sys.exit("build the extension first:\n uv run maturin develop\nSee README.md.")
-
datafusion-ffi-example/run_demo.py— walk the conformance matrix in numbered sections: table provider, functions, catalog provider, config extension, codec round-trip, then the same bytes decoded a second time. That last section is only truthful after the logical-codec sub-issue lands, and it is the one place in the repository where the guide's central rule is demonstrated rather than asserted. -
datafusion-ffi-query-planner-example/run_demo.py— print plans, not rows. Planner nesting is understood by seeing the indented tree, and the existing tests assert on plan strings they never show. Cover the logical plan handed to the planner, the physical plan returned, the effect ofSET ffi_query_planner.max_rows, and two planners nesting. Use.display_indent(). -
Role:header on each tree's README, so the label survives the click fromexamples/README.md, which already distinguishes the trees but loses the distinction as soon as you follow the link. Three lines: what this tree is, where to go if you are learning the protocol, and how to run it.
Scope note: make them runnable, but do not promise datafusion-ffi-example reads as a tutorial. It is a coverage matrix — .ai/skills/check-upstream/SKILL.md:455 instructs adding every new FFI type to it — so it grows under protocol pressure rather than narrative need. The planner crate is single-topic and can carry the stronger claim.
- 主要语言
- Python
- 星标
- 605
- 派生
- 176
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 8
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/datafusion-python 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
apache/datafusion-python#1757 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 72/100
apache/datafusion-python#1726 ·
-
难度 2/5 半天 新手友好度 88/100
apache/datafusion-python#1691 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
apache/datafusion-python#1644 ·
-
enhancement
难度 5/5 一周以上 新手友好度 30/100
apache/datafusion-python#1737 ·
查看 apache/datafusion-python 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
canonical/paas-charm#368 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
tech debt
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 90/100
StevenBlack/hosts#3256 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
qualcomm/qai-appbuilder#275 ·