Skip to content

Read the DASH_VALIDATE_CALLBACKS environment variable - #4220

Open
leninworld wants to merge 2 commits into
plotly:devfrom
leninworld:fix/validate-callbacks-env
Open

leninworld wants to merge 2 commits into
plotly:devfrom
leninworld:fix/validate-callbacks-env

Conversation

@leninworld

Copy link
Copy Markdown

This PR fixes issue #4219.

DASH_VALIDATE_CALLBACKS is documented for dev_tools_validate_callbacks in Dash.run and Dash.enable_dev_tools, but load_dash_env_vars() did not list it, so it was ignored: without an explicit dev_tools_validate_callbacks argument, the setting followed debug. This adds it to the list, next to the other dev tools variables.

As with the other boolean DASH_ variables, only true and false (any case) are parsed. An already exported DASH_VALIDATE_CALLBACKS now takes effect when no explicit argument is given.

Contributor Checklist

  • This PR targets dev (fix), see Which branch to target
  • I have broken down my PR scope into the following TODO tasks
    • Load DASH_VALIDATE_CALLBACKS in dash/_configs.py
    • Add a unit test for env value, explicit argument and default
    • Add an integration test that the env value reaches the served page config
  • I have run the tests locally and they passed. (refer to testing section in contributing)
  • I have added tests, or extended existing tests, to cover any new features or bugs fixed in this PR

Test run: tests/unit/test_configs.py, tests/unit/test_app_runners.py and the new test in tests/integration/devtools/test_callback_validation.py (Flask test client, no browser), using the Python sources of this branch over an installed Dash 4.5.2 (no local front-end build). The two new env unit cases and the new integration test fail on dev and pass here. Two other tests fail both with and without the change in that setup (test_missing_flask_compress_raises, because flask-compress was installed, and test_process_server_smoke). black, flake8 and pylint pass on the changed files. I also ran the app from the issue headed in a browser: on dev the "Circular Dependencies" error still appears with DASH_VALIDATE_CALLBACKS=false, and with this change it does not. The Selenium browser tests were not run.

optionals

  • I have added entry in the CHANGELOG.md

@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] DASH_VALIDATE_CALLBACKS environment variable is ignored

1 participant