-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Do not require all extra params in salesforce hook #18929
Do not require all extra params in salesforce hook #18929
Conversation
Previously, code used `extras["blah"] or None` instead of simply `extras.get("blah")`. This forces users to add each of these optional params to the connection extra. Now, we use `extras.get` and you only need to supply the extra param if you need it.
see #18800 |
With how the custom connection fields currently work, there will always be a key for each of the custom fields in In the if all(arg is not None for arg in (username, password, security_token)):
... Unfortunately there is no Because the empty string is not |
All the authentication type logic in the Salesforce API starts here if you'd like to check it out. |
@josh-fell if you use secrets backend then what you say about custom connection fields does not apply, and when you upgrade to this provider, your connection no longer works |
Ah I see. Valid point. |
I see so maybe we need to do get or None instead of slice or None? |
Seems like the best approach. |
@dstandish / @josh-fell |
My PR is open that handles the defaulting to None issue (and also updates the tests to test it is handled correctly: #19530 |
Closing as issue solved in #19530 |
This is a small fixup for the salesforce hook.
Previously, code used
extras["blah"] or None
instead of simplyextras.get("blah")
, which forces users to add each of these optional params to the connection extra.In this PR we use
extras.get
, which means user only needs to supply the extra param if necessary.