Make examples/ behave like examples: runnable, and consistent with the extension guide

Aperta
#1,723 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python, rust

Direzione di ricerca

Inizia da extension-guide/codecs.md e user-guide/data-sources.md:219, poi esamina i tre alberi sotto examples/ e datafusion-ffi-example/logical_extension_codec.rs:148. Esegui le test suite pytest esistente per stabilirne gli attuali punti di ingresso. Il lavoro è concluso quando gli esempi sono eseguibili, il codec logico non dipende più da un registro dei provider globale al processo, la quarantena del piano fisico è esplicita e la guida corrisponde al codice.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

documentation enhancement

#1721 added examples/distributed as a worked example and, in doing so, exposed two structural problems with the older example trees that the new one throws into relief.

The guide contradicts the code it points at. extension-guide/codecs.md tells authors to encode durable metadata, then spends a paragraph explaining that our own examples do not. Readers copy examples; an example that contradicts the rule beside it is worse than no example. #1719 records the reference-implementation half of this as G9, which examples/distributed/storage-library now satisfies — but the crate a reader is most likely to open first still does the wrong thing.

Two of the three trees have no runnable entry point. datafusion-ffi-example is 13 pytest files and no script; datafusion-ffi-query-planner-example is one pytest file and no script. This is not only an aesthetic problem: user-guide/data-sources.md:219 calls datafusion-ffi-example a "user example" and routes Python users to it from the user guide. They arrive at a test suite.

Investigation while reviewing #1721 found the first problem is smaller and differently shaped than the guide claims. Each item below was checked against the source, not inferred:

  • datafusion-ffi-query-planner-example has no object registry at all — grep -rn "HashMap\|OnceLock\|TOKEN" src/ is empty. It claims node.is::<DistributedExec>() narrowly and writes a fixed durable marker. The guide named it anyway. Corrected in #1721.
  • datafusion-ffi-example's logical codec parks providers in a process-global HashMap, and this is cheaply fixable: it claims MemTable narrowly (logical_extension_codec.rs:148), and a MemTable is fully describable as schema plus batches.
  • datafusion-ffi-example's physical codec parks plans, and this is not fixable here. It is forced by the greedy ForeignExecutionPlan claim, which is load-bearing for upstream defect apache/datafusion#25152 — that is G2 in #1719. Once you claim a node you cannot introspect, parking it is the only remaining option. The work is to make it uncopyable, not to remove it.

So the end state is one quarantined arm carrying an issue number and a delete-when condition, rather than a systemic contradiction.

Decided while planning this: the example trees stay in examples/. Relocating the conformance beds to an integration-tests/ tree was considered and rejected — making them runnable resolves the "these aren't examples" complaint, and a move would churn roughly 40 doc, README, and agent-skill references, none of which any build step validates.

Sub-issues track the pieces. They are ordered: the prose rewrite describes the state the first two produce.

Lingua principale
Python
Stelle
605
Fork
176
Merge medio
1g 23h
PR unite (30g)
8

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/datafusion-python

Tutte le issue di apache/datafusion-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.