Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix inconsistent return types in selector values #562

Merged
merged 5 commits into from
Jul 5, 2024

Conversation

huong-li-nguyen
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen commented Jul 3, 2024

Description

Previously if you've specified the options of a selector as a List[Dict] inside a Parameter, the value was returned as a List[Dict] when "ALL" was selected (introduced by us), but would return a List of values only when selecting other values from the multi selector (dash default). This could lead to issues when using custom charts, as it's not immediately transparent for the user what the return type is, see #557.

  • Fixes inconsistent return types in selectors by always returning a List (similar to Dash)

FYI: @lingyielia @petar-qb @antonymilne

Screenshot

Notice

  • I acknowledge and agree that, by checking this box and clicking "Submit Pull Request":

    • I submit this contribution under the Apache 2.0 license and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
    • I certify that (a) this contribution is my original creation and/or (b) to the extent it is not my original creation, I am authorized to submit this contribution on behalf of the original creator(s) or their licensees.
    • I certify that the use of this contribution as authorized by the Apache 2.0 license does not violate the intellectual property rights of anyone else.
    • I have not directly or indirectly referenced individuals, products or companies in any commits.
    • I have not added data or restricted code in any commits, directly or indirectly.

@huong-li-nguyen huong-li-nguyen self-assigned this Jul 3, 2024
@huong-li-nguyen huong-li-nguyen added the Bug Report 🐛 Issue contains a bug report label Jul 3, 2024
Copy link
Contributor

@lingyielia lingyielia left a comment

Choose a reason for hiding this comment

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

Thanks Li! I agree with should follow Dash default in this case. Approved with 2 comments.

vizro-core/examples/_dev/app.py Show resolved Hide resolved
Copy link
Contributor

@antonymilne antonymilne left a comment

Choose a reason for hiding this comment

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

Amazing work all round @GiulioMorinaQB for the great bug report and @lingyielia and @huong-li-nguyen for the very speedy temporary and permanent fix! 💯

Just to check: @huong-li-nguyen does the new test fail before your fix?

@huong-li-nguyen
Copy link
Contributor Author

Just to check: @huong-li-nguyen does the new test fail before your fix?

Yes, of course! That's how I checked that the test was working 😄

@huong-li-nguyen huong-li-nguyen enabled auto-merge (squash) July 5, 2024 18:16
@huong-li-nguyen huong-li-nguyen merged commit 6ba4119 into main Jul 5, 2024
30 checks passed
@huong-li-nguyen huong-li-nguyen deleted the bug/fix-selector-return-type branch July 5, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report 🐛 Issue contains a bug report
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameters as dictionary of label-value mappings not working in custom chart when "ALL" selected
3 participants