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] Ignore unexpected query parameters rather than raising an exception #539

Merged
merged 10 commits into from
Jun 21, 2024

Conversation

antonymilne
Copy link
Contributor

@antonymilne antonymilne commented Jun 19, 2024

Description

Before
Going to http://localhost:8050/?species=virginica would raise error:

TypeError: Dashboard._make_page_layout() got an unexpected keyword argument 'species'

This was kind of a bug and kind of expected behaviour that we just didn't care about.

Now
The query parameter is just ignored.

This is the solution recommended in https://github.com/AnnMarieW/dash-multi-page-app-demos/?tab=readme-ov-file#5-preventing-query-string-errors. it doesn't prevent us from using query parameters in the future (very likely to do so) and is consistent with behaviour if layout is no longer a function at some point in the future (not so likely).

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 referenced individuals, products or companies in any commits, directly or indirectly.
    • I have not added data or restricted code in any commits, directly or indirectly.

@antonymilne antonymilne changed the title Ignored unexpected query parameters rather than raising an exception [Fix] Ignore unexpected query parameters rather than raising an exception Jun 19, 2024
@antonymilne antonymilne changed the title [Fix] Ignore unexpected query parameters rather than raising an exception [Bug] Ignore unexpected query parameters rather than raising an exception Jun 19, 2024
Copy link
Contributor

@huong-li-nguyen huong-li-nguyen left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@antonymilne
Copy link
Contributor Author

Not sure why my new integration test isn't work well... We might need to move this to your QA tests instead @l0uden.

Copy link
Contributor

@petar-qb petar-qb left a comment

Choose a reason for hiding this comment

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

Looks good!

@l0uden l0uden temporarily deployed to circleci_secrets June 20, 2024 14:50 — with GitHub Actions Inactive
@l0uden
Copy link
Contributor

l0uden commented Jun 20, 2024

Not sure why my new integration test isn't work well... We might need to move this to your QA tests instead @l0uden.

I'll write in vizro-qa repo

@l0uden l0uden temporarily deployed to circleci_secrets June 20, 2024 15:05 — with GitHub Actions Inactive
@antonymilne antonymilne merged commit af12fc6 into main Jun 21, 2024
33 checks passed
@antonymilne antonymilne deleted the bug/query-parameters branch June 21, 2024 08:24
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.

None yet

4 participants