-
Notifications
You must be signed in to change notification settings - Fork 89
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
Harden configuration reading #2701
Conversation
value = config.get(key, {}).get("value", "") | ||
value = config.get(key, {}) | ||
if isinstance(value, dict): | ||
value = value.get("value", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bug: otherwise value
is None
. add an else statement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could also happen in line 48 and the function signature allows return type None
. It will break when get_secret
is True
## Changes Harden configuration reading by verifying the type before reading the "value" using `.get` ### Linked issues Resolves databrickslabs#2581 (hopefully the second get is the issue, type hinting should cover that, but who knows) ### Functionality - [x] modified existing workflow: `assessment` ### Tests - [x] added unit tests
Changes
Harden configuration reading by verifying the type before reading the "value" using
.get
Linked issues
Resolves #2581 (hopefully the second get is the issue, type hinting should cover that, but who knows)
Functionality
assessment
Tests