apache / apache/datafusion-python

Missing docstring examples in the `unparser` module

Ouverte Adaptée aux débutants
#1,691 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
604
Forks
174
Merge moyen
1 j 7 h
PR mergées (30 j)
4

Description

## 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.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Start in python/datafusion/unparser.py and read the existing Dialect and Unparser docstrings, then inspect the current SELECT 1 unparser test for setup. Add doctest-style examples showing the dialect differences, clarify the Dialect and with_pretty summaries, and run pytest with --doctest-modules. Done means all listed public functions have passing usage examples and the wording is corrected.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
documentation
Type d'issue
Documentation
Difficulté
2/5
Temps estimé
Une demi-journée
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
88/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.