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

Local config no longer fails to import silently #8006

Merged
merged 4 commits into from
Aug 8, 2019

Conversation

DiggidyDave
Copy link
Contributor

CATEGORY

Choose one

  • [] Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Previously, local superset_config or configured (via env) file could fail to import and superset would swallow the error and continue to run. Now, if user has provided a path or a superset_config.py and it fails to import, the exception will be clearly logged and re-raised causing superset to stop immediately.

TEST PLAN

Manually tested with both forms of config (env and superset_config), with and without various errors.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@betodealmeida @mistercrunch @john-bodley

for key in dir(override_conf):
if key.isupper():
setattr(module, key, getattr(override_conf, key))

else:
print("Loaded your LOCAL configuration at [{}]".format(cfg_path))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: can you update this to use f-strings? Superset no longer supports Python < 3.6.

print("Loaded your LOCAL configuration at [{}]".format(cfg_path))
except Exception:
logging.exception(
"Failed to import config for {}={}".format(CONFIG_PATH_ENV_VAR, cfg_path)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: same here, using f-strings.

except ImportError:
pass
except Exception:
logging.exception("Failed to import local superset_confg")
Copy link
Member

Choose a reason for hiding this comment

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

Typo: "superset_config"

superset/config.py Show resolved Hide resolved
@mistercrunch
Copy link
Member

closes #8004

@DiggidyDave
Copy link
Contributor Author

@betodealmeida @mistercrunch et al... can someone kick the CI, it looks like some sporadic, unrelated issues caused it to fail.

@betodealmeida betodealmeida merged commit cd544fa into apache:master Aug 8, 2019
@DiggidyDave DiggidyDave deleted the logConfigLoadFailure branch August 16, 2019 23:04
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/M 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants