Missing docstring examples in the `unparser` module

Offen Anfängerfreundlich
#1,691 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
Ein halber Tag
Anfängerfreundlichkeit
88/100
Issue-Typ
Dokumentation
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
documentation

Rechercherichtung

Beginne in python/datafusion/unparser.py und lies die vorhandenen Docstrings von Dialect und Unparser. Sieh dir anschließend den aktuellen Unparser-Test für SELECT 1 an, um die Einrichtung zu verstehen. Füge Beispiele im doctest-Stil hinzu, die die Unterschiede zwischen den Dialekten zeigen, präzisiere die Zusammenfassungen von Dialect und with_pretty und führe pytest mit --doctest-modules aus. Erledigt ist die Aufgabe, wenn alle aufgelisteten öffentlichen Funktionen über erfolgreiche Verwendungsbeispiele verfügen und die Formulierungen korrigiert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Description

AGENTS.md requires every public Python function to carry a usage example, but
none of the public functions in python/datafusion/unparser.py have one:

  • Dialect.default
  • Dialect.mysql
  • Dialect.postgres
  • Dialect.sqlite
  • Dialect.duckdb
  • Unparser.plan_to_sql
  • Unparser.with_pretty

The gap matters more here than in most modules, because the reason Dialect
exists is that different dialects render the same plan differently, and nothing
in the current documentation shows that difference. The existing test unparses
SELECT 1, which is identical across all four dialects.

Two smaller documentation problems sit in the same file:

  • the Dialect class summary reads "DataFusion data catalog."
  • with_pretty is documented as "Set the pretty flag.", which does not say
    what the flag changes.

Expected Behavior

All public functions in the module carry doctest-style usage examples,
consistent with the rest of the package and executed by pytest's
--doctest-modules.

Suggested Improvement

Add examples that unparse the same plan through each dialect so the differences
are visible, and correct the two docstrings noted above.

Vorherrschende Sprache
Python
Sterne
605
Forks
176
Ø Merge
1 T. 23 Std.
Gemergte PRs (30 T.)
8

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/datafusion-python

Alle Issues in apache/datafusion-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.