Repository navigation
Fix numeric customdata in Graph events - #4076
monsterlag wants to merge 1 commit into
Conversation
|
|
Thanks for the PR! We'll take a closer look and follow up. |
T4rk1n
left a comment
There was a problem hiding this comment.
Reading the decoded array from _inputArray and converting typed arrays before serialization covers scalar, row and 3D customdata, and plain lists still go through the same code as before. Re-enabling grbs005 and checking against all of pointNumbers is a good tightening. Two small asks, neither blocking: can you add a CHANGELOG entry under Fixed for #3196, and swap the hand-rolled wait in grbs005 for the helper (inline)?
| assert data != "", "graph clickData must contain data" | ||
|
|
||
| data = json.loads(data) | ||
| wait.until( |
There was a problem hiding this comment.
Can you use dash_dcc.wait_for_contains_text("#text-area", '"points"') here instead of wait.until on find_element? contains_text already checks the textarea value. The raw find_element inside until can throw a stale element error if the Textarea re-renders between the lookup and the read, and we've seen that flake elsewhere in the suite.
|
I'd rather not rely on private variables if possible. |



Note
AI-generated, not reviewed by a human. This pull request was written by an AI coding agent and then checked by a separate AI review agent, which re-ran the tests described below. No human has reviewed the code. It is submitted by @monsterlag, who runs these agents. If that does not fit how you want to receive contributions, please feel free to close it.
Fixes #3196.
Numeric NumPy and pandas
customdatacan be sent by Plotly.py as binary array objects. Graph indexed those objects instead of their decoded values, droppingcustomdatafrom callback event data.Use Plotly.js's cached decoded array and convert typed-array values to plain arrays before serialization. This preserves scalar and row-valued data in click, hover and selection events without changing plain-list handling.
Add browser coverage for Scatter and Scattergl, including a nonzero trace index, and restore the pie customdata regression test.
Testing
python -m pytest components/dash-core-components/tests/integration/graph/test_graph_basics.py --headless -xvs: 22 passed with Plotly.py 7.1.0. Before rebuilding with the fix, the focused customdata tests had 5 failures and 4 passing list controls.python -m pytest components/dash-core-components/tests/integration/graph/test_graph_basics.py -k 'grbs005 or grbs007 or grbs013' --headless -xvs: 10 passed with Plotly.py 6.0.1.python -m pytest tests/unit: 729 passed, 6 skipped.python -m pytest tests/compliance/: 54 passed, 1 skipped.components/dash-core-components:npm run test:jest -- --runInBand(85 passed) andnpm run lint(passed, with existing warnings in unrelated files).Contributor Checklist