Missing docstring examples in the `unparser` module

Đang mở Phù hợp với người mới
#1,691 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
88/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu trong python/datafusion/unparser.py và đọc các docstring hiện có của Dialect và Unparser, sau đó kiểm tra test unparser hiện tại cho SELECT 1 để biết cách thiết lập. Thêm các ví dụ theo kiểu doctest cho thấy sự khác biệt giữa các dialect, làm rõ phần tóm tắt của Dialect và with_pretty, rồi chạy pytest với --doctest-modules. Công việc được hoàn tất khi tất cả các hàm public được liệt kê đều có ví dụ sử dụng chạy thành công và cách diễn đạt đã được sửa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
605
Fork
176
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
8

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/datafusion-python

Tất cả issue của apache/datafusion-python

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.