Circular Import Dependency in Plotly Templates
オープン
まだ誰も着手していません。
bug
P1
- 主要言語
- Python
- スター
- 18.8k
- フォーク
- 2.8k
- 平均マージ
- 16時間 26分
- マージ済み PR(30日)
- 21
説明
The issue is that plotly's template system has a circular import dependency:
plotly.graph_objs.__init__.pyimports all trace types including Heatmapgl- During this import process, it also loads template data
layout/template/data/_heatmapgl.pytries toimport Heatmapgl from plotly.graph_objs- But plotly.graph_objs is still in the process of being imported!
This occurred when attempting to use plotly and plotly-resampler and a heatmap.
Reproduction of Error
Minimal reproduction code:
import plotly.graph_objs as go
go.Heatmapgl() # ✅ Success
# But this fails:
from plotly_resampler import FigureResampler
fig = FigureResampler(go.Figure()) # ❌ Circular import
Versions affected:
plotly==5.24.1
plotly-resampler==0.10.0
Work around
This can be worked around by forcing import order:
import plotly.graph_objs # Force full initialization first
from plotly_resampler import FigureResampler # Then import resampler
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
plotly==5.24.1 と plotly-resampler==0.10.0 で失敗を再現し、その後 plotly.graph_objs.init.py と layout/template/data/_heatmapgl.py を調査します。報告された FigureResampler の例からインポート順序を追跡します。例が、事前に手動で plotly.graph_objs をインポートしなくても図をインポートして構築できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- data-visualization
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100