[BUG] dcc.Upload contents and dcc.Geolocation position docstrings describe the wrong value format

未關閉
#4,125 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

@ZainnQureshii 已經在處理了。

開始於 2026年11月6日。

  • #4126 來自 @ZainnQureshii —— 未關閉

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
30/100
Issue 類型
文件
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
python, react

研究方向

Update the dcc.Upload.contents and dcc.Geolocation.position docstrings in the cited component files: components/dash-core-components/src/components/Upload.react.js and src/components/Geolocation.react.js. Read the current wording alongside the behavior cited in the issue, then check the generated Python help for both components. Done when the help describes contents as a base64 data URL and unavailable position fields as null (None in Python); pull request #4126 is already open.

由索引模型根據 Issue 內容生成。

描述

bug P3 size: 1

Describe your context

Current dev (dash 4.5.0). Docs only; no specific browser or OS.

Describe the bug

Two dcc prop docstrings describe a value format the component does not produce. Both reach users through the generated Python help (help(dcc.Upload), help(dcc.Geolocation)).

  1. dcc.Upload.contents says "The contents of the uploaded file as a binary string" (components/dash-core-components/src/components/Upload.react.js:29). The component reads every file with reader.readAsDataURL(file) (src/fragments/Upload.react.js:189) and passes reader.result through unchanged (:173), so contents is a base64 data URL (data:<mime type>;base64,<data>), which callbacks have to split and base64-decode.

  2. dcc.Geolocation.position says the optional fields are included "when available, otherwise it will be NaN" (src/components/Geolocation.react.js:122). The component sets each field with ?? null (:59-65), so an unavailable value arrives as null (None in a Python callback), not NaN.

Expected behavior

  • contents: "The contents of the uploaded file as a base64 encoded data URL (data:<mime type>;base64,<data>)".
  • position: "... otherwise it will be null (None in Python)".

I'm happy to send the PR for both lines.

(Found and written up with AI assistance, Claude Code; the cited lines were checked against dev.)

主要語言
Python
星號
24.5k
分支
2.3k
平均合併
3 天 7 小時
30 天內合併 PR
30

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

plotly/dash 的其他 Issue

查看 plotly/dash 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。