Use group_by(maintain_order=True) in process_dataframe_hierarchy once narwhals exposes it
まだ誰も着手していません。
評価
- 難易度
- 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 の本文から書いたものです。
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
plotly/plotly.py のほかの issue
-
P3 size: 1 task
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug P1
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
feature P3
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
feature P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug P1 size: 1
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
plotly/plotly.py の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·