josh-fell edited a comment on pull request #18800:
URL: https://github.com/apache/airflow/pull/18800#issuecomment-942342173
@gigatexal Are you seeing `KeyError` exceptions when using the latest
Salesforce provider?
With how the custom connection fields currently work, there will always be a
key for each of the custom fields in `Extra`. Since each one of these
Salesforce connection params have their own custom field in the connection
form, if a value is not provided it defaults to `""`. Users aren't required to
enter a value for each extra param.
In the `simple-salesforce` package, the logic that determines what
authentication type to use are all similar in format to:
```python
if all(arg is not None for arg in (username, password, security_token)):
...
```
Unfortunately there is no `authentication_type` that is passed to explicitly
state the authentication a user would like to integrate with.
Because the empty string is not `None`, there are chances that the incorrect
authentication type is chosen which was the choice for the slightly clunky
`extras["extra__salesforce__<conn-field>"] or None` approach.
All the authentication type logic in the Salesforce API starts
[here](https://github.com/simple-salesforce/simple-salesforce/blob/30ad772f81935b604b6461e17e1c92c16f77f9b2/simple_salesforce/api.py#L122)
if you'd like to check it out.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]