Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#5,769 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
65/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

plotly/express/_core.py の process_dataframe_hierarchy を読み、narwhals の最小バージョンで group_by に maintain_order が公開されていることを確認してください。回帰チェックには test_sunburst_treemap_with_path_order を使用してください。一時的な順序付けの仕組みがなくなり、テストが引き続き成功し、パスベースの sunburst、treemap、icicle の順序が決定的であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
18.8k
フォーク
2.8k
平均マージ
13時間 41分
マージ済み PR(30日)
21

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

plotly/plotly.py のほかの issue

plotly/plotly.py の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。