apache / apache/datafusion-python

Missing docstring examples in the `unparser` module

未關閉 適合新手
#1,691 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 python/datafusion/unparser.py 開始,閱讀現有的 Dialect 和 Unparser 文件字串,然後檢查目前的 SELECT 1 unparser 測試以了解設定方式。新增展示方言差異的 doctest 風格範例,釐清 Dialect 和 with_pretty 的摘要,並執行帶有 --doctest-modules 的 pytest。所有列出的 public 函式都有通過測試的使用範例,且措辭已修正,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
documentation
Issue 類型
文件
難度
2/5
預估耗時
半天
活躍度
活躍
描述清晰度
描述清楚
新手友好度
88/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。