Repository navigation
Fix callbacks registered twice under reload when Dash() gets an explicit name - #4053
Open
raashish1601 wants to merge 2 commits into
Open
raashish1601 wants to merge 2 commits into
raashish1601 wants to merge 2 commits into
Conversation
|
Author
|
The "Run performance benchmarks" failure isn't from this change. The benchmarks themselves report all within thresholds. The job then fails when it tries to post its results comment ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Dash.__init__passedcaller_nametoalias_main_module. Whennameis given,caller_nameis that name. SoDash("myapp"), orDash(__name__)inside an app factory module, never matched"__main__"/"__mp_main__". The alias was skipped, uvicorn's"repro:server"import ran the file again, and every callback was registered twice.Now the alias uses
get_caller_name(), the module that is actually running, whatevernameis. The app name (caller_name) is unchanged. In the factory case the running module is the entry script that calls the factory, so that script gets aliased.Tested:
tests/unit/test_main_module_alias.py: explicitname, and an app built by a factory called from the main module. Both fail ondevand pass here.uvicorn.run(..., reload=True)./_dash-dependencieslistsoutput.childrentwice ondev, once with this change.pytest tests/unit: the only failures are thetest_pages.pypath tests,test_pages_config.pyandtest_process_server_smoke. They fail the same way ondevon my Windows machine. pylint, flake8 and black pass on the changed files.Contributor Checklist
Dash()gets an explicitnameoptionals
CHANGELOG.mdFixes #3912