GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix dcc.Upload contents and dcc.Geolocation position docstrings by ZainnQureshii · Pull Request #4126 · plotly/dash

Conversation

@ZainnQureshii

@ZainnQureshii ZainnQureshii commented Nov 6, 2026

Copy link
Copy Markdown

Fixes #4125

Two dcc prop docstrings describe a value format the component does not produce:

  • dcc.Upload.contents said "binary string". The component reads each file with reader.readAsDataURL(file) (src/fragments/Upload.react.js:189) and pushes reader.result unchanged (:173), so the value is a base64 data URL. The docstring now says so and shows the data:<mime type>;base64,<data> shape.
  • dcc.Geolocation.position said unavailable fields are NaN. The component builds them with ?? null (src/components/Geolocation.react.js:59-65), so they arrive as null (None in a Python callback). The docstring now says null, which the Python generator already renders as None (fix_keywords in dash/development/_py_components_generation.py).

Docstrings only, no behavior change, so no test is added. The generated Python wrappers pick the text up on the next build.

Contributor Checklist

  • This PR targets dev (fix or chore) or next (feature, new API, breaking change), see Which branch to target
  • I have broken down my PR scope into the following TODO tasks
    • dcc.Upload contents docstring
    • dcc.Geolocation position docstring
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

optionals

  • I have added entry in the CHANGELOG.md
  • If this PR needs a follow-up in dash docs, community thread, I have mentioned the relevant URLS as follows
    • this GitHub #PR number updates the dash docs
    • here is the show and tell thread in Plotly Dash community

Prepared with AI assistance (Claude Code) and reviewed with GitHub Copilot.

Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ZainnQureshii @claude
Fix dcc.Upload contents and dcc.Geolocation position docstrings
d605280
Upload reads files with readAsDataURL, so contents is a base64 data URL,
not a binary string. Geolocation sets missing optional fields with
`?? null`, so they arrive as null, not NaN.

Fixes plotly#4125

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

T4rk1n
T4rk1n approved these changes Nov 9, 2026
View reviewed changes

@T4rk1n T4rk1n left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both docstrings now match what the components do. Upload reads files with readAsDataURL and passes reader.result through unchanged, and Geolocation fills missing fields with ?? null. No changes needed from my side.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@T4rk1n T4rk1n T4rk1n approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ZainnQureshii @T4rk1n
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.