apache / apache/datafusion-python
Missing docstring examples in the `unparser` module
- 主要语言
- Python
- 星标
- 604
- 派生
- 174
- 平均合并
- 1 天 7 小时
- 30 天内合并 PR
- 4
描述
## 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.
贡献指南
这个仓库没有索引到贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 2/5
- 预计耗时
- 半天
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 88/100