Skip to content

fix(dashboards): Handle null/undefined at top level in toPythonString#111297

Merged
DominikB2014 merged 4 commits intomasterfrom
dominikbuszowiecki/browse-465-make-topythonstring-more-robust
Mar 23, 2026
Merged

fix(dashboards): Handle null/undefined at top level in toPythonString#111297
DominikB2014 merged 4 commits intomasterfrom
dominikbuszowiecki/browse-465-make-topythonstring-more-robust

Conversation

@DominikB2014
Copy link
Contributor

toPythonString converted null/undefined inside arrays to 'None' but fell through to String(null)"null" at the top level. Python's str(None) returns "None", so when a groupBy value is null, the JS-side string didn't match the backend's "None", causing the breakdown legend to fail to find matching table rows.

Adds a null/undefined check before the array branch, and refactors the array item mapping to use recursive toPythonString calls so boolean/null handling is consistent at all nesting levels. Adds unit tests covering strings, booleans, null, undefined, numbers, and mixed arrays.

toPythonString was converting null/undefined inside arrays to 'None'
but falling through to String(null) → "null" at the top level. Python's
str(None) returns "None", so groupBy values of null would not match the
backend's "None" string, causing breakdown legend row matching to fail.

Add null/undefined check before the array branch and refactor array
item mapping to use recursive toPythonString calls. Add unit tests
covering all data types.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@linear-code
Copy link

linear-code bot commented Mar 23, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 23, 2026
@DominikB2014
Copy link
Contributor Author

@sentry review

@DominikB2014
Copy link
Contributor Author

@cursor review

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Narrow the type before calling String() to avoid the
@typescript-eslint/no-base-to-string error on the unknown fallback path.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@DominikB2014 DominikB2014 marked this pull request as ready for review March 23, 2026 15:53
@DominikB2014 DominikB2014 requested a review from a team as a code owner March 23, 2026 15:53
@DominikB2014 DominikB2014 requested a review from gggritso March 23, 2026 15:54
@DominikB2014
Copy link
Contributor Author

@gggritso a follow up from the last pr!

@DominikB2014 DominikB2014 merged commit 1378ba1 into master Mar 23, 2026
70 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-465-make-topythonstring-more-robust branch March 23, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants