Give the two FFI example crates a runnable entry point

オープン
#1,727 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, rust

調査の方向性

examples/tpch/run_tpch.py、両方の FFI crates にある既存の python/tests 配下の pytest ファイル、および test.yml:136-150 から始めて、テストコマンドを確認します。各 root run_demo.py、その subprocess driver(anchor assertions 付き)、および README の Role ヘッダーを追加します。完了条件は、両方のスクリプトが standalone で実行でき、各 driver のテストがパスすることです。2 つ目の decode セクションは logical-codec sub-issue に従うものとします。

索引モデルが issue の本文から書いたものです。

説明

enhancement python

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 of SET 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 from examples/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時間
マージ済み PR(30日)
8

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/datafusion-python のほかの issue

apache/datafusion-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。