Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Use group_by(maintain_order=True) in process_dataframe_hierarchy once narwhals exposes it

Đang mở Phù hợp với người mới
#5,769 0 bình luận 1 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
1-3 giờ
Mức phù hợp với người mới
65/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
data-visualization

Hướng nghiên cứu

Đọc process_dataframe_hierarchy trong plotly/express/_core.py và xác nhận rằng phiên bản narwhals tối thiểu cung cấp maintain_order trên group_by. Dùng test_sunburst_treemap_with_path_order làm kiểm tra hồi quy; được xem là hoàn tất khi cơ chế sắp xếp tạm thời đã được loại bỏ, test vẫn chạy thành công và thứ tự dựa trên đường dẫn của sunburst, treemap và icicle vẫn mang tính xác định.

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

Mô tả

P3 size: 1 task
Description

process_dataframe_hierarchy (plotly/express/_core.py), which builds the data for px.sunburst, px.treemap and px.icicle when path is used, adds a temporary row index column, aggregates its minimum per group and sorts each level by it. This is there only to get a deterministic sector order out of group_by, whose row order is not guaranteed for every backend (#5765, #5766).

narwhals is planning to expose maintain_order on group_by (narwhals-dev/narwhals#3309). Once that lands and the minimum supported narwhals version in pyproject.toml includes it, the temporary column, its aggregation and the per-level sort can be dropped in favour of df.group_by(path[i:], drop_null_keys=True, maintain_order=True).

The existing test_sunburst_treemap_with_path_order test covers the behaviour, so it should keep passing after the switch.

Filed as a follow up to #5766, as suggested by @camdecoster in #5765.

Ngôn ngữ chính
Python
Star
18.8k
Fork
2.8k
Merge trung bình
13 giờ 41 phút
Pull request đã merge (30 ngày)
21

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

Mở hướng dẫn đóng góp

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 plotly/plotly.py

Tất cả issue của plotly/plotly.py

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.