plotly / plotly/dash

aio components custom attributes not passed down

オープン
#2,004 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

bug P3
主要言語
Python
スター
24.4k
フォーク
2.3k
平均マージ
2日 7時間
マージ済み PR(30日)
13

説明

Describe your context

dash                      2.3.1
dash-core-components      2.0.0
dash-html-components      2.0.0
dash-labs                 1.0.3
dash-table                5.0.0

Following six line demonstrator works with static layout:

 app.layout = layout()

but fails to initialise when invoked dynamically:

  app.layout = layout

The issue is with the method simple_clone(), in dash.py/L566. The Dash layout clone method
fails to pass in the value total_items=100. This is significant problem since the sub-classing the
standard Dash components is used extensively when implementing the reusable components
AIO pattern.

class MyDiv(html.Div):
    def __init__(self, children=None, className='some-class', total_items=None, page_size=10):

        # Fails with TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
        pages = total_items / page_size

        print(pages)
        super().__init__(pages, className=className)

def layout():
    return MyDiv(total_items=100)

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

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

はじめの一歩

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

調査の方向性

dash.py の L566 付近から始め、提供されている MyDiv の例を使って simple_clone() を調べてください。静的な layout() と動的な layout を比較し、カスタム属性 total_items=100 が保持されることを確認して、動的な layout が示されている TypeError なしで初期化されるようにしてください。

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

評価

技術スタック
python
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

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

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